import sys import math def ask(a: int, b: int) -> int: print(f"? {a} {b}", flush=True) line = sys.stdin.readline() if not line: sys.exit(0) v = int(line) if v == -1: # Invalid query format / exceeded limit / judge terminated sys.exit(0) return v def answer(val): print(f"! {val}", flush=True) sys.exit(0) def main(): line = sys.stdin.readline() if not line: return N = int(line) msd = N - 1 # most significant digit index y = [0] * (N - 1) nz = [] # Query products with the most significant digit. for i in range(N - 1): p = ask(i, msd) y[i] = p if p > 0: nz.append(i) digits = [0] * N if len(nz) >= 2: a, b = nz[0], nz[1] z = ask(a, b) # x_a * x_b if z <= 0: answer(-1) num = y[a] * y[b] if num % z != 0: answer(-1) c2 = num // z c = math.isqrt(c2) if c * c != c2 or not (1 <= c <= 9): answer(-1) digits[msd] = c for i in range(N - 1): if y[i] % c != 0: answer(-1) d = y[i] // c if not (0 <= d <= 9): answer(-1) digits[i] = d ans = "".join(str(digits[i]) for i in range(N - 1, -1, -1)) answer(ans) elif len(nz) == 1: i = nz[0] p = y[i] cand = [] for c in range(1, 10): if p % c == 0: d = p // c if 1 <= d <= 9: cand.append((c, d)) if len(cand) != 1: answer(-1) c, d = cand[0] digits[msd] = c digits[i] = d ans = "".join(str(digits[k]) for k in range(N - 1, -1, -1)) answer(ans) else: # All y[i] are 0 -> x_i=0 for all i