// #pragma GCC target("avx2") // #pragma GCC optimize("O3") // #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using lg = long long; using pii = pair; using pll = pair; #define TEST cerr << "TEST" << endl #define AMARI 998244353 // #define AMARI 1000000007 #define TEMOTO ((sizeof(long double) == 16) ? false : true) #define TIME_LIMIT 1980 * (TEMOTO ? 1 : 1000) #define el '\n' #define El '\n' //0始まりの添え字で良いよ ありがとう void print_quetion(int i,int j){ cout << '?'; cout << ' ' << i + 1; cout << ' ' << j + 1; cout << '\n'; cout << flush; return; } void print_ans(vector const& a,vector const& b){ cout << '!'; for(int i = 0; i < a.size(); i++)cout << ' ' << a[i]; for(int i = 0; i < b.size(); i++)cout << ' ' << b[i]; cout << '\n'; cout << flush; return; } #define MULTI_TEST_CASE false void solve(void) { int n; cin >> n; if(n == 1){ print_ans({1},{1}); return; } int p; //n以下の最大の素数pを探す for(int i = n; i >= 1; i--){ //iが素数かどうか調べる 時間はたっぷりある bool sosuu = true; for(int j = 2; j * j <= i; j++){ if(i % j == 0){ sosuu = false; break; } } if(sosuu){ p = i; break; } } int p1 = -1,p2 = -1; for(int i = 0; i < n; i++){ print_quetion(i,i); int lcm; cin >> lcm; if(lcm % p == 0){ if(p1 == -1)p1 = i; else p2 = i; } } if(p2 == -1){ //a[p1] = b[p1] = p vector a(n),b(n); a[p1] = b[p1] = p; for(int i = 0; i < n; i++){ if(i == p1)continue; print_quetion(i,p1); int temp; cin >> temp; a[i] = temp / p; } for(int i = 0; i < n; i++){ if(i == p1)continue; print_quetion(p1,i); int temp; cin >> temp; b[i] = temp / p; } print_ans(a,b); return; } print_quetion(p1,p2); int temp; cin >> temp; if(temp == p){ vector a(n),b(n); a[p1] = b[p2] = p; for(int i = 0; i < n; i++){ if(i == p1)continue; print_quetion(i,p2); int t2; cin >> t2; a[i] = t2 / p; } for(int i = 0; i < n; i++){ if(i == p2)continue; print_quetion(p1,i); int t2; cin >> t2; b[i] = t2 / p; } print_ans(a,b); return; } swap(p1,p2); vector a(n),b(n); a[p1] = b[p2] = p; for(int i = 0; i < n; i++){ if(i == p1)continue; print_quetion(i,p2); int t2; cin >> t2; a[i] = t2 / p; } for(int i = 0; i < n; i++){ if(i == p2)continue; print_quetion(p1,i); int t2; cin >> t2; b[i] = t2 / p; } print_ans(a,b); return; } void calc(void) { return; } int main(void) { cin.tie(nullptr); ios::sync_with_stdio(false); calc(); int t = 1; if(MULTI_TEST_CASE) cin >> t; while(t--) { solve(); } return 0; }