uses crt;
var n,d,kt,i,b:integer;
st:string;
a:array[1..100]of integer;
begin
clrscr;
write('nhap n='); readln(n);
str(n,st);
d:=length(st);
kt:=0;
for i:=1 to d do
val(st[i],a[i],b);
for i:=1 to d do
if a[i]>1 then
begin
kt:=1;
writeln('ban da nhap sai, yeu cau ban nhap lai');
end;
if kt=0 then
begin
if n mod 3=0 then writeln('thoa man')
else writeln('khong thoa man');
end;
readln;
end.