program SumOfSquareDigits;
varnum, n, sum, digit: integer;
beginnum := 1;
while num <= 200 dobeginn := num;sum := 0;
end;end.
program SumOfSquareDigits;
var
num, n, sum, digit: integer;
begin
num := 1;
while num <= 200 do
while n > 0 dobegin
n := num;
sum := 0;
begin
digit := n mod 10;
sum := sum + digit * digit;
n := n div 10;
end;
if sum = 24 then
writeln(num);
num := num + 1;
end;
end.