program h; const n=200000; var i,k,b,j,m :integer;a:array [1..n,1..2]of integer; f1, f2: text; begin assign (f1,'task.in'); assign (f2, 'task.out'); reset (f1); read (f1,m); rewrite(f2); for i:=1 to m do for j:=1 to 2 do read (a[i,j]); for j:=1 to 2 do for i:=i to 2 do if (a[i,j]>a[i,j+1]) and (a[i,j+1]>a[i+1,j]) or (a[i,j]