# Generate all of C_3 and C_4
# This confuses solutions that fail to investigate crossing edges in BFS layer
# before investigating edges to the next layer


# The graph is 1 with neighbours 2, 3, 4, 5. 
# An edge connects a pair from 2, 3, 4, 5, given by the arguments.
# The remaining neighbours of 1 are joined to  the single distance-2 vertex, called 6
# E.g., 
#   intralayer 3 5
# builds
#
#
#   3-1-2- 6
#   |/ \  /
#   5   4


import sys

n = 6
m = 7
u, v = int(sys.argv[1]), int(sys.argv[2])

print(n, m)
print(1,2)
print(1,3)
print(1,4)
print(1,5)
print(u, v)
for w in (2,3,4,5):
    if w in [u, v]:
        continue
    print(w, 6)
