program fermath_test_for_prime_numbers;
function bigmultiplication(x,y,n:longint):longint;
var
doi:longint;
begin
doi:=0;
while(y>0) do
begin
if(y mod 2 =1) then
begin
doi:=(doi+x)mod n;
end;
x:=(2*x)mod n;
y:=y div 2;
end;
bigmultiplication:=doi;
end;
function exponents_mod_n(x,y,n:longint):longint;
var
doi,doing:longint;
begin
doing:=x;
doi:=1;
while(y>0) do
begin
if(y mod 2 =1) then
begin
doi:=bigmultiplication(doi,doing,n);
end;
doing:=bigmultiplication(doing,doing,n);
y:=y div 2;
end;
exponents_mod_n:=doi;
end;
var
a,p,x,n:longint;
i,flag:integer;
begin
Randomize;
readln(p);
flag:=0;
if p mod 2 = 0 then
begin
writeln('the number is composite');
end;
for i:=1 to 7 do
begin
x:=p-1;
a:=random(x)+1 mod x;
n:=exponents_mod_n(a,x,p);
if n<>1 then
begin
writeln('the number is composite');
flag:=1;
break;
end;
end;
if flag = 0 then
writeln('this is prime number');
end.
cHJvZ3JhbSBmZXJtYXRoX3Rlc3RfZm9yX3ByaW1lX251bWJlcnM7CmZ1bmN0aW9uIGJpZ211bHRpcGxpY2F0aW9uKHgseSxuOmxvbmdpbnQpOmxvbmdpbnQ7CnZhciAKZG9pOmxvbmdpbnQ7CmJlZ2luCglkb2k6PTA7Cgl3aGlsZSh5PjApIGRvCgliZWdpbgoJCWlmKHkgbW9kIDIgPTEpIHRoZW4KCQliZWdpbgoJCQlkb2k6PShkb2kreCltb2QgbjsKCQllbmQ7CgkJCgkJeDo9KDIqeCltb2QgbjsKCQkJeTo9eSBkaXYgMjsKCWVuZDsKCWJpZ211bHRpcGxpY2F0aW9uOj1kb2k7CmVuZDsKCgoKCmZ1bmN0aW9uIGV4cG9uZW50c19tb2Rfbih4LHksbjpsb25naW50KTpsb25naW50Owp2YXIKZG9pLGRvaW5nOmxvbmdpbnQ7CmJlZ2luCglkb2luZzo9eDsKCWRvaTo9MTsKCXdoaWxlKHk+MCkgZG8KCWJlZ2luCgkJaWYoeSBtb2QgMiA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