uses crt;
var
a,b,c,d:0..9;
n:1000..9999;
begin
clrscr;
for a:=1 to 9 do
for b:=0 to 9 do
for c:=0 to 9 do
for d:=0 to 9 do
begin
n:=a*1000+b*100+c*10+d;
if (n mod 6=0) and (n mod 27=0) and (d+c=b+c) then
writeln(n)
end;
program 1 readkey
end.
Program _2;
uses crt;
var
a,b,c:1..20;
begin
clrscr;
for a:=1 to 20 do
for b:=1 to 20 do
for c:=1 to 20 do
if a*a*b=c*c then
writeln(a,' ',b,' ',c);
readkey
end.