Var n,z,k:integer;
begin
write('Введите сумму: ');
readln(n);
k:=500;
z := n div k;
n := n mod k;
if z>0 then writeln(k,' * ',z);
k:=100;
z := n div k;
n := n mod k;
if z>0 then writeln(k,' * ',z);
k:=50;
z := n div k;
n := n mod k;
if z>0 then writeln(k,' * ',z);
k:=10;
z := n div k;
n := n mod k;
if z>0 then writeln(k,' * ',z);
k:=5;
z := n div k;
n := n mod k;
if z>0 then writeln(k,' * ',z);
k:=1;
z := n div k;
n := n mod k;
if z>0 then writeln(k,' * ',z);
end.