program noip5_1;
var
s:string;
lk:integer;
ans:array[0..12] of integer;
score:array[1..14] of record
one,two:integer;
end;
procedure init;
var
i:integer;
st:string;
begin
fillchar(score,sizeof(score),$FF);
readln(s); s:=s+' ';
st:=''; lk:=0;
for i:=1 to length(s) do
if (s[i]<>' ')
then st:=st+s[i]
else begin
inc(lk);
if st[1]='/' then begin
score[lk].one:=10;
score[lk].two:=-1
end
else begin
score[lk].one:=ord(st[1])-48;
if st[2]='/' then score[lk].two:=10-score[lk].one
else score[lk].two:=ord(st[2])-48
end;
st:='';
end;
end;
procedure main;
var
i,len:integer;
begin
fillchar(ans,sizeof(ans),$FF);
for i:=1 to 12 do
begin
if score[i].one=10
then begin
if score[i+1].two<>-1
then ans[i]:=10+score[i+1].one+score[i+1].two
else
if (score[i+1].one<>-1) and (score[i+2].one<>-1)
then ans[i]:=10+score[i+1].one+score[i+2].one;
end
else
if score[i].one+score[i].two=10
then begin
if score[i+1].one<>-1
then ans[i]:=10+score[i+1].one
end
else
if (score[i].one<>-1) and (score[i].two<>-1)
then ans[i]:=score[i].one+score[i].two;
end;
for i:=1 to 12 do
if ans[i]=-1 then break;
len:=i-1;
for i:=1 to len-1 do
write(ans[i],' ');
writeln(ans[len]);
ans[0]:=0;
for i:=1 to len-1 do
begin
ans[i]:=ans[i-1]+ans[i];
write(ans[i],' ');
end;
writeln(ans[len]+ans[len-1]);
end;
begin
assign(input,'bowling.in');
assign(output,'bowling.out');
reset(input); rewrite(output);
init;
main;
close(input); close(output);
end.