Program task;
var a,b,c,d,n,s:longint;
begin
writeln('vvedite chislo 4-значноe chislo');read(a);
b:= a div 1000;
c:= a div 100 mod 10;
d:= a div 10 mod 10 ;
n:= a mod 10;
writeln('n=',n);
writeln('b=',b);
writeln('c=',c);
writeln('d=',d);
writeln('s=',b+c+d+n);
end.