program ohjelma;
uses
SysUtils, RegExpr;
var
i: string;
tempstr: string;
z: Integer;
match: TRegExpr;
f: Integer;
item: Integer;
begin
ReadLn(i);
tempstr := '.';
while tempstr <> '' do
begin
z := 0;
tempstr := '';
match := TRegExpr.Create;
match.Expression := '\d';
if match.Exec(i) then
begin
z := StrToInt(match.Match[0]);
f := match.MatchPos[0];
Delete(i, f, 1);
for item := 1 to z do
begin
tempstr := tempstr + i[item + f - 1];
z := z - 1;
end;
Insert(tempstr, i, f);
end;
match.Free;
end;
WriteLn(i);
end.