uses crt;
var x,n,d,i:longint;
st,st1:string;
a:integer;
{----------------------chuong-trinh-con-tim-ucln---------------------}
function ucln(a,b:longint):longint;
var t:longint;
begin
t:=b mod a;
while t<>0 do
begin
t:=a mod b;
a:=b;
b:=t;
end;
ucln := a;
end;
{-------------------chuong-trinh-chinh-----------------}
begin
clrscr;
write('nhap x='); readln(x);
str(x,st);
d:=length(st);
st1:=''
for i:=d downto 1 do
st1:=st1+st[i];
val(st1,n,a);
if ucln(x,n)=1 then writeln('Phai')
else writeln('khong phai');
readln;
end.