uses wincrt,strings;

const numbers:string = '0123456789';

function contains(s:string; c:char):boolean;
  var i:integer;
      is:boolean;
  begin
    is := false;
    for i := 1 to length(s) do
      is := is or (c=s[i]);
    contains := is;
  end;

var s:string; i,j,k,l:integer;

begin
  writeln('Enter the compressed string:  '); readln(s);
  i := 1;
  j := 0;
  while i<=length(s) do
    begin
      if contains(numbers,s[i]) then
        inc(j)
      else
        begin
          if j=0 then k := 1 else val(copy(s,i-j,j),k,l);
          for l := 1 to k do
            write(s[i]);
          j := 0;
        end;
      inc(i);
    end;
end.