var
a, n: longint;
text: textfile;
function myMod(num, power, divider: longint): longint;
rest, i: longint;
begin
rest:=1;
divider := abs(divider);
for i := 1 to power do
rest := rest * num;
rest := rest mod divider;
end;
myMod := rest;
assign(text, 'input.txt');
{rewrite(text);
writeln(text, 1);
close(text);}
reset(text);
read(text, a);
writeln('a=', a);
close(text);
n := 0;
repeat
n := n + 1;
until MyMod(n, n, a) = 0;
writeln('n=', n);
assign(text, 'output.txt');
rewrite(text);
writeln(text, n);
{reset(text);
read(text, n);
end.
program ;
i, a: longint;
x,
u, j,
n, m : longint;
function fdiv (a, left : longint) : longint;
d,
i : longint;
d : = 1;
for i : = left to trunc (sqrt (a)) do
if (a mod i = 0)
then
d : = i;
break;
if (d < > 1)
fdiv : = d
else
fdiv : = a;
function g (n, u : longint) : longint;
i : = 0;
while (n mod u = 0)
do
inc (i);
n : = n div u;
g : = i;
assign (input, 'input.txt');
assign (output, 'output.txt');
reset (input);
read (a);
close (input);
m : = 0;
n : = 1;
i : = fdiv (a, 2);
u : = 2;
while (a > 1)
n : = n * i;
j : = 0;
while (a mod i = 0)
inc (j);
a : = a div i;
if (j > m)
m : = j;
u : = i;
i : = fdiv (a, i + 2);
x : = 1;
while (g (n * x, u) * n * x < m)
inc (x);
n : = n * x;
rewrite (output);
write (n);
close (output);
var
a, n: longint;
text: textfile;
function myMod(num, power, divider: longint): longint;
var
rest, i: longint;
begin
rest:=1;
divider := abs(divider);
for i := 1 to power do
begin
rest := rest * num;
rest := rest mod divider;
end;
myMod := rest;
end;
begin
assign(text, 'input.txt');
{rewrite(text);
writeln(text, 1);
close(text);}
reset(text);
read(text, a);
writeln('a=', a);
close(text);
n := 0;
repeat
n := n + 1;
until MyMod(n, n, a) = 0;
writeln('n=', n);
assign(text, 'output.txt');
rewrite(text);
writeln(text, n);
close(text);
{reset(text);
read(text, n);
writeln('n=', n);
close(text);}
end.
program ;
var
i, a: longint;
x,
u, j,
n, m : longint;
function fdiv (a, left : longint) : longint;
var
d,
i : longint;
begin
d : = 1;
for i : = left to trunc (sqrt (a)) do
if (a mod i = 0)
then
begin
d : = i;
break;
end;
if (d < > 1)
then
fdiv : = d
else
fdiv : = a;
end;
function g (n, u : longint) : longint;
var
i : longint;
begin
i : = 0;
while (n mod u = 0)
do
begin
inc (i);
n : = n div u;
end;
g : = i;
end;
begin
assign (input, 'input.txt');
assign (output, 'output.txt');
reset (input);
read (a);
close (input);
m : = 0;
n : = 1;
i : = fdiv (a, 2);
u : = 2;
while (a > 1)
do
begin
n : = n * i;
j : = 0;
while (a mod i = 0)
do
begin
inc (j);
a : = a div i;
end;
if (j > m)
then
begin
m : = j;
u : = i;
end;
i : = fdiv (a, i + 2);
end;
x : = 1;
while (g (n * x, u) * n * x < m)
do
inc (x);
n : = n * x;
rewrite (output);
write (n);
close (output);
end.