description: This is an interactive problem.
  
  You are given two integers c and n. The jury has a randomly generated set A of distinct positive integers not greater than c (it is generated from all such possible sets with equal probability). The size of A is equal to n.
  
  Your task is to guess the set A. In order to guess it, you can ask at most ⌈ 0.65 ⋅ c ⌉ queries.
  
  In each query, you choose a single integer 1 ≤ x ≤ c. As the answer to this query you will be given the [bitwise xor sum](https://en.wikipedia.org/wiki/Bitwise_operation#XOR) of all y, such that y ∈ A and gcd(x, y) = 1 (i.e. x and y are coprime). If there is no such y this xor sum is equal to 0.
  
  You can ask all queries at the beginning and you will receive the answers to all your queries. After that, you won't have the possibility to ask queries.
  
  You should find any set A', such that |A'| = n and A' and A have the same answers for all c possible queries.
  
  Input
  
  Firstly you are given two integers c and n (100 ≤ c ≤ 10^6, 0 ≤ n ≤ c).
  
  Interaction
  
  In the first line you should print an integer q (0 ≤ q ≤ ⌈ 0.65 ⋅ c ⌉) — the number of queries you want to ask. After that in the same line print q integers x_1, x_2, …, x_q (1 ≤ x_i ≤ c) — the queries.
  
  For these queries you should read q integers, i-th of them is the answer to the described query for x = x_i.
  
  After that you should print n distinct integers A'_1, A'_2, …, A'_n — the set A' you found.
  
  If there are different sets A' that have the same answers for all possible queries, print any of them.
  
  If you will ask more than ⌈ 0.65 ⋅ c ⌉ queries or if the queries will be invalid, the interactor will terminate immediately and your program will receive verdict Wrong Answer.
  
  After printing the queries and answers do not forget to output end of line and flush the output buffer. Otherwise, you will get the Idleness limit exceeded verdict. To do flush use:
  
    * fflush(stdout) or cout.flush() in C++; 
    * System.out.flush() in Java; 
    * flush(output) in Pascal; 
    * stdout.flush() in Python; 
    * Read documentation for other languages. 
  
  
  
  Hacks
  
  You cannot make hacks in this problem.
  
  Example
  
  Input
  
  
  10 6
  
  1 4 2 11 4 4 4
  
  
  
  Output
  
  
  7 10 2 3 5 7 1 6
  
  1 4 5 6 8 10
  
  Note
  
  The sample is made only for you to understand the interaction protocol. Your solution will not be tested on the sample.
  
  In the sample A = \{1, 4, 5, 6, 8, 10\}. 7 queries are made, 7 ≤ ⌈ 0.65 ⋅ 10 ⌉ = 7, so the query limit is not exceeded.
  
  Answers for the queries: 
  
    * For 10: 1 is the only number in the set A coprime with 10, so the answer is 1 
    * For 2: 1_{10} ⊕ 5_{10} = 001_2 ⊕ 101_2 = 4_{10}, where ⊕ is the bitwise xor 
    * For 3: 1_{10} ⊕ 4_{10} ⊕ 5_{10} ⊕ 8_{10} ⊕ 10_{10} = 0001_2 ⊕ 0100_2 ⊕ 0101_2 ⊕ 1000_2 ⊕ 1010_2 = 2_{10} 
    * For 5: 1_{10} ⊕ 4_{10} ⊕ 6_{10} ⊕ 8_{10} = 0001_2 ⊕ 0100_2 ⊕ 0110_2 ⊕ 1000_2 = 11_{10} 
    * For 7: 1_{10} ⊕ 4_{10} ⊕ 5_{10} ⊕ 6_{10} ⊕ 8_{10} ⊕ 10_{10} = 0001_2 ⊕ 0100_2 ⊕ 0101_2 ⊕ 0110_2 ⊕ 1000_2 ⊕ 1010_2 = 4_{10} 
    * For 1: 1_{10} ⊕ 4_{10} ⊕ 5_{10} ⊕ 6_{10} ⊕ 8_{10} ⊕ 10_{10} = 0001_2 ⊕ 0100_2 ⊕ 0101_2 ⊕ 0110_2 ⊕ 1000_2 ⊕ 1010_2 = 4_{10} 
    * For 6: 1_{10} ⊕ 5_{10} = 0001_2 ⊕ 0101_2 = 4_{10} 
solution: #include <bits/stdc++.h>
  using namespace std;
  const long long INFLL = 1e18;
  const int INF = 1e9 + 1;
  const int MAXC = 1e6;
  mt19937 gen(time(0));
  vector<int> e(MAXC + 5);
  void precalc() {
    vector<int> p;
    for (int i = 2; i <= MAXC; i++) {
      if (e[i] == 0) {
        e[i] = i;
        p.emplace_back(i);
      }
      for (int j = 0; j < (int)p.size() && p[j] * i <= MAXC && p[j] <= e[i];
           j++) {
        e[p[j] * i] = p[j];
      }
    }
  }
  int f(int x) {
    int ans = 1;
    vector<int> p;
    while (x > 1) {
      p.emplace_back(e[x]);
      x /= e[x];
    }
    for (int i = 0; i < (int)p.size(); i++) {
      if (i + 1 == (int)p.size() || p[i + 1] != p[i]) ans *= p[i];
    }
    return ans;
  }
  void gauss(int need, vector<int> &lst, vector<int> &ans,
             vector<vector<int>> &sz, vector<vector<vector<int>>> &v) {
    int n = lst.size();
    vector<bitset<20>> a(n);
    for (int i = 0; i < n; i++) a[i] = lst[i];
    bitset<20> b = need;
    vector<bitset<260>> l(n);
    for (int i = 0; i < n; i++) l[i][i] = 1;
    int i = 0;
    vector<int> col(20, -1);
    int bas_sz = 0;
    for (int j = 0; j < 20 && i < n; j++) {
      int i1 = i;
      while (i1 < n && a[i1][j] == 0) i1++;
      if (i1 == n) continue;
      swap(a[i], a[i1]);
      swap(l[i], l[i1]);
      bas_sz++;
      col[j] = i;
      for (int i2 = i + 1; i2 < n; i2++) {
        if (a[i2][j]) {
          a[i2] ^= a[i];
          l[i2] ^= l[i];
        }
      }
      i++;
    }
    bitset<20> res;
    bitset<260> path;
    for (int j = 0; j < 20; j++) {
      if (res[j] != b[j] && col[j] == -1) {
        exit(0);
      }
      if (res[j] == b[j]) continue;
      res ^= a[col[j]];
      path ^= l[col[j]];
    }
    if (a.back().count() != 0) {
      for (int i = 0; i < n; i++) {
        if (path[i]) ans.emplace_back(lst[i]);
      }
      return;
    }
    vector<int> diff_sz(300);
    sz.emplace_back();
    v.emplace_back();
    for (int it = 0; it < 100; it++) {
      bitset<260> now = path;
      for (int i = 0; i < n - bas_sz; i++) {
        if (gen() % 2) now ^= l[bas_sz + i];
      }
      int now_sz = now.count();
      if (diff_sz[now_sz]) continue;
      v.back().emplace_back();
      for (int i = 0; i < n; i++) {
        if (now[i]) v.back().back().emplace_back(lst[i]);
      }
      diff_sz[now_sz] = 1;
      sz.back().emplace_back(now_sz);
    }
  }
  vector<int> mem(2 * MAXC + 5, -1);
  int query(int x) { return mem[f(x)]; }
  void solve(int n, int c) {
    vector<int> calc(c + 1);
    vector<vector<int>> total(c + 1);
    for (int x = 1; x <= c; x++) total[f(x)].emplace_back(x);
    vector<int> need;
    for (int x = 1; x <= c; x++) {
      if (total[x].size()) need.emplace_back(x);
    }
    cout << need.size() << " ";
    for (auto &c : need) cout << c << " ";
    cout << endl;
    for (auto &c : need) {
      int x;
      cin >> x;
      mem[c] = x;
    }
    int total_xor = query(1);
    for (int x = 1; x <= c; x++) {
      if (total[x].empty()) continue;
      for (int y = x; y <= c; y += x) calc[y] ^= (query(x) ^ total_xor);
    }
    calc[1] = total_xor;
    for (int x = c; x >= 1; x--) {
      if (total[x].empty()) continue;
      for (int y = 2 * x; y <= c; y += x) {
        if (total[y].size()) calc[x] ^= calc[y];
      }
    }
    vector<int> ans;
    vector<vector<int>> sz;
    vector<vector<vector<int>>> v;
    for (int x = 1; x <= c; x++) {
      if (total[x].empty()) continue;
      gauss(calc[x], total[x], ans, sz, v);
    }
    vector<bitset<40000>> bag(sz.size() + 1);
    bag[0][0] = 1;
    for (int i = 1; i <= (int)sz.size(); i++) {
      for (auto &x : sz[i - 1]) {
        bag[i] |= (bag[i - 1] << x);
      }
    }
    int now = n - ans.size();
    for (int i = (int)sz.size(); i >= 1; i--) {
      for (int j = 0; j < (int)sz[i - 1].size(); j++) {
        int x = sz[i - 1][j];
        if (now - x >= 0 && bag[i - 1][now - x]) {
          now -= x;
          for (auto &y : v[i - 1][j]) ans.emplace_back(y);
          break;
        }
      }
    }
    sort((ans).begin(), (ans).end());
    for (auto &c : ans) cout << c << " ";
    cout << endl;
  }
  int main() {
    precalc();
    int c, n;
    cin >> c >> n;
    solve(n, c);
    return 0;
  }
  