var
s : integer;
begin
read (s);
writeln ('500 =', s div 500);
s := s mod 500;
writeln ('100 = ', s div 100);
s := s mod 100;
writeln ('50 =', s div 50);
s := s mod 50;
writeln ('10 = ', s div 10);
s := s mod 10;
writeln ('Не смог сдать = ', s);
end.