#include using namespace std; int n,cnt; int query(int a,int b){ cout << "? " << a << " " << b << endl; int x; cin >> x; return x; } int main(){ cin >> n; vector a(n - 1); for(int i = 0; i < n - 1; i++){ a[i] = query(n - 1,i); } int cnt = 0,t = 0; for(int i = 1;i <= 9; i++){ int valid = 1; for(int j = 0; j < n - 1; j++){ if(a[j] % i || (a[j] / i > 9)){ valid = 0; break; } } cnt += valid; if(valid) t = i; } if(cnt == 1){ cout << "! " << t; for(int i = n - 2; i >= 0; i--){ cout << a[i] / t; } cout << endl; } else{ int c = 0,x = 0,y = 0; for(int i = 0; i < n - 1; i++){ if(a[i]) c++,x = y,y = i; } if(c <= 1){ cout << "! " << -1 << endl; return 0; } else{ cout << "? " << y << " " << x << endl; int z; cin >> z; for(int i = 1; i <= 9; i++){ if(a[x] % i == 0 && a[y] % i == 0 && (a[x] / i) * (a[y] / i) == z){ t = i; break; } } cout << "! " << t; for(int i = n - 2; i >= 0; i--){ cout << a[i] / t; } cout << endl; } } }