Срочно !!!!!!! писать на паскале
begin
var s := (ReadInteger()).ToString;
repeat
var sum := 0;
for var i := 1 to s.Length do
sum += s[i].toDigit;
s := sum.ToString;
until s.Length = 1;
s.Println;
end.