uses crt;
var S,n,i; integer;
begin
clrscr;
repeat
writeln('Nhap n = '); read(n);
until n<1000000000;
i:=n-1;
While i<n do
begin
S := 0; While ( i <> 0 ) do
Begin k := i mod 10;
i := i div 10;
S := S + k;
end;
end;
if S = 10 then write(i);
readln
end.