var t,i,j,l1,l2,c:integer; a,b:string; begin readln(t); for i:=1 to t do begin l1:=0; l2:=0; readln(a,b); l1:=l1+length(a); l2:=l2+length(b); if (l1>l2) then c:=c+l2; if (l10) then write(a) else write(b); end; end.