I=lambda:list(map(int,input().split())) A,E=I() B,F=I() C,D=I() if E