#!/usr/bin/env python3
import sys
import random

k = int(sys.argv[1])
positions = [int(i) for i in sys.argv[2].split('-')]
deltas = [int(i) for i in sys.argv[3].split('-')]

positions *= k
deltas *= k

n = len(positions)
print(n)
t = 0
for i in range(n):
    print(t, positions[i])
    t += deltas[i]
