#include int main() { int N; std::cin >> N; auto comp = [](int i, int j) { if (i == j) { return false; } std::cout << "? " << i << " " << j << "\n"; int T; std::cin >> T; return T == 1; }; std::vector v(N); std::iota(v.begin(), v.end(), 1); std::sort(v.begin(), v.end(), comp); std::cout << "!\n" << N - 1 << "\n"; for (int i = 0; i < N; i++) { std::cout << v[i] << " \n"[i + 1 == N]; } }