Var n,i,l:integer; s1,s2:string;
begin
write('n = '); readln(n);
for i:=1 to n do
begin
str(i,s1); l:=length(s1);
str(i*i,s2);
if s1=copy(s2,length(s2)-l+1,l) then writeln(i,'*',i,'=',i*i);
end;
end.
n = 1000
1*1=1
5*5=25
6*6=36
25*25=625
76*76=5776
376*376=141376
625*625=390625