X = int(input()) if X == 1: print(2) print(1, 2) print("b g") exit() M = 2 * 10 ** 5 L = [] for i in range(2, M + 1): while X % i == 0: L.append(i) X //= i if X != 1: print(-1) exit() now = len(L) GB = ["b"] * now ans = [] for i in range(now - 1): ans.append((i + 1, i + 2)) now += 1 for i in range(len(L)): for j in range(L[i]): ans.append((i + 1, now)) now += 1 GB.append("g") if len(GB) > M: print(-1) exit() print(len(GB)) for a, b in ans: print(a, b) print(*GB)