/** author: shobonvip created: 2026.04.18 21:11:41 **/ #include using namespace std; //* ATCODER #include using namespace atcoder; typedef modint998244353 mint; //*/ /* BOOST MULTIPRECISION #include using namespace boost::multiprecision; //*/ typedef long long ll; #define rep(i, s, n) for (int i = (int)(s); i < (int)(n); i++) #define rrep(i, s, n) for (int i = (int)(n)-1; i >= (int)(s); i--) #define all(v) v.begin(), v.end() template bool chmin(T &a, const T &b) { if (a <= b) return false; a = b; return true; } template bool chmax(T &a, const T &b) { if (a >= b) return false; a = b; return true; } template T max(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmax(ret, a[i]); return ret; } template T min(vector &a){ assert(!a.empty()); T ret = a[0]; for (int i=0; i<(int)a.size(); i++) chmin(ret, a[i]); return ret; } template T sum(vector &a){ T ret = 0; for (int i=0; i<(int)a.size(); i++) ret += a[i]; return ret; } int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; auto ask = [&](int x,int y) -> int { if (x>y) swap(x,y); cout << "? " << x << ' ' << y << endl; int v; cin >> v; return v; }; vector v(n-1); rep(i,0,n-1) { v[i] = ask(n-1,i); } if (max(v) == 0) { cout << "!" << ' ' << -1 << endl; return 0; } vector ind; rep(i,0,n-1) { if (v[i] > 0) ind.emplace_back(i); } if ((int)ind.size() == 1) { int cnt = 0; rep(x,1,10) { rep(y,1,10) { if (x * y == v[ind.front()]) { cnt++; } } } if (cnt > 1) { cout << "!" << ' ' << -1 << endl; return 0; } rep(x,1,10) { rep(y,1,10) { if (x * y == v[ind.front()]) { vector ans(n); ans[n-1] = x; rep(i,0,n-1) { ans[i] = v[i] / x; } cout << "! "; rrep(i,0,n) { cout << ans[i]; } cout << endl; return 0; } } } } // 特定可能 int w = ask(ind.front(), ind.back()); int tops = int(sqrt(v[ind.front()] * v[ind.back()] / w)); vector ans(n); ans[n-1] = tops; rep(i,0,n-1) { ans[i] = v[i] / tops; } cout << "! "; rrep(i,0,n) { cout << ans[i]; } cout << endl; }