Program hotrotinhoc;
var a,b,max,x,d,i,y: longint;
n,k,s: string;
begin
readln(n); s:=n;
while length(n)<>1 do
begini:=i+1;
k:=k+
s[i];
val(k,x);
delete(n,1,1);
val(n,y);
d:=x+y;
if d>max then
begin
max:=y+x;
a:=x;
b:=y;
end;
end;
write(a,' ',b);
readln
end.