var s,st,c,p:string;
i,a,b:longint;
begin
write('Nhap xau thu nhat: ');readln(s);
write('Nhap xau thu hai: ');readln(st);
c:='';
p:='';
for i := 1 to length(s) do
if s[i] in ['0'..'9'] then c := c + s[i];
for i := 1 to length(st) do
if st[i] in ['0'..'9'] then p := p + st[i];
while c[1] = '0' do delete(c,1,1);
while p[1] = '0' do delete(p,1,1);
if (c ='') and (p='') then
begin
writeln('Tong = 0');
exit;
end;
val(c,a);
val(p,b);
writeln('So thu nhat: ',c);
writeln('So thu hai: ',p);
writeln('Tong: ',a+b);
readln;
end.