a=[int(i)for i in input().split()] b=[int(i)for i in input().split()] c=[[a[0],b[1],b[2]],[b[0],a[1],b[2]],[b[0],b[1],a[2]]] d=[[b[0],a[1],a[2]],[a[0],b[1],a[2]],[a[0],a[1],b[2]]] for i in range(3): if c[i][0]c[i][2]or c[i][0]>c[i][1]d[i][2]or d[i][0]>d[i][1]