# def intersect(a, b, p, q):
#     ax, bx = min(a[0], b[0]), max(a[0], b[0])
#     px, qx = min(p[0], q[0]), max(p[0], q[0])
#     if bx < px or ax > qx:
#         return False
#     ay, by = min(a[1], b[1]), max(a[1], b[1])
#     py, qy = min(p[1], q[1]), max(p[1], q[1])
#     if by < py or ay > qy:
#         return False
#
#
# print(intersect((3, 4), (1, 2), (5, 6), (7, 8)))
# pass
