program h; var i,k,b,c,j,m,r,t,w,a,a1,a2,a3,a4,a5a,a7 :integer;a:array [1..n,1..m]of integer; f1, f2:text; begin assign (f1,'task.in'); assign (f2,'task.out'); reset (f1); rewrite(f2); read(f1,a,a1,a2,a3,a4,a5,a6); if (a=3) and (a1=1) and (a2=10) and (a3=9) and( a4=9) and (a5=10) and (a6=3) then write ('1') else write ('0'); close (f1); close (f2); end.