x=int(input()) if x==1: print(2) print(1,2) print("b","g") exit() # 素因数分解 import math L=int(math.sqrt(x)) FACT=dict() for i in range(2,L+2): while x%i==0: FACT[i]=FACT.get(i,0)+1 x=x//i if x!=1: FACT[x]=FACT.get(x,0)+1 LIST=[] for f in FACT: x=FACT[f] if f==2: while x>=2: LIST.append(4) x-=2 if x==1: LIST.append(2) else: for i in range(x): LIST.append(f) if len(LIST)+sum(LIST)>200000: print(-1) else: X=len(LIST)+sum(LIST) print(X) ANS=[] for i in range(1,len(LIST)): ANS.append((i,i+1)) c=len(LIST)+1 for i in range(1,len(LIST)+1): for j in range(LIST[i-1]): ANS.append((i,c)) c+=1 for x,y in ANS: print(x,y) LL=["b"]*len(LIST)+["g"]*sum(LIST) print(" ".join(LL))