procedure suprimare(var s:string);
var c,i:integer;
begin
c:=length(s);
for i:=1 to c do
if s[i]='#' then
delete(s,i,1);
end;
var s1,s2:string;
begin{pp}
write('s1=');readln(s1);
write('s2=');readln(s2);
suprimare(s1);
suprimare(s2);
writeln(s1);
write(s2);
readln;
end.