def prime_factorize(n): a = [] while n % 2 == 0: a.append(2) n //= 2 f = 3 while f <= INF and f * f <= n: if n % f == 0: a.append(f) n //= f else: f += 2 if n != 1: a.append(n) return a X = int(input()) INF = 2 * 10 ** 5 D = prime_factorize(X)[::-1] if D == []: D = [1] D2 = [] while len(D) >= 2 and D[-2:] == [2,2]: D.pop() D.pop() D2.append(4) D += D2 ans = len(D) + sum(D) if ans > INF: print(-1) exit() b = len(D) UV = [] tmp = b for i in range(b): if i > 0: UV.append((i - 1, i)) for d in range(D[i]): UV.append((i, tmp)) tmp += 1 else: print(ans) for u, v in UV: print(u + 1, v + 1) C = ["b"] * b + ["g"] * (ans - b) print(*C)