Uses crt;
var input, betw:integer;
begin
readln(input);
betw := input;
betw := betw div 10;
betw := betw div 10;
betw := betw div 10;
writeln('Тысяч = ', betw);
betw := input;
betw := betw div 10;
betw := betw div 10;
betw := betw mod 10;
writeln('Сотен = ', betw);
betw := input;
betw := betw div 10;
betw := betw mod 10;
writeln('Десятков = ', betw);
betw := input;
betw := betw mod 10;
writeln('Единиц = ', betw); end.