// つら #include #define all(v) v.begin(), v.end() #define eb emplace_back #define fast cin.tie(nullptr); ios_base::sync_with_stdio(false) using namespace std; using ll = long long; using ull = unsigned long long; constexpr ll mod = 998244353; bool query(vector &b){ int s = b.size(); cout << "? " << s << " "; for(int i=0;i> res; return res == "Yes"; } int n; int main(){ fast; cin >> n; vector cnt(n + 1); int rem = n; for(int i = 1; i <= n; i++){ if(rem == 0) break; vector tmp; int c = 0; for(int j = 1; j <= rem; j++){ tmp.eb(i); if(!query(tmp)){ c = j - 1; break; } c = j; } cnt[i] = c; rem -= cnt[i]; } vector ans = vector(cnt[1],1); for(int i = 2; i <= n; i++){ if(cnt[i] == 0) continue; vector base = ans; int s = (int)base.size(); vector add(s + 1, 0); for(int k = 1; k <= cnt[i]; k++){ int l = 0, r = s + 1; while(r - l > 1){ int m = (l + r) / 2; vector tmp; tmp.reserve(m + k); for(int j = 0; j < m; j++) tmp.eb(base[j]); for(int j = 0; j < k; j++) tmp.eb(i); if(query(tmp)) l = m; else r = m; } add[l]++; } vector newans; newans.reserve(s + cnt[i]); for(int p = 0; p <= s; p++){ for(int t = 0; t < add[p]; t++) newans.eb(i); if(p < s) newans.eb(base[p]); } ans.swap(newans); } cout << "! "; for(auto &x : ans){ cout << x << " "; } cout << endl; }