#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
struct Sync_stdio {
  Sync_stdio() {
    cin.tie(NULL);
    ios_base::sync_with_stdio(false);
  }
} _sync_stdio;
struct FAIL {
  FAIL() {
    cout << "CHANGE!!!"
         << "\n";
  }
};
int n, x, y;
int add = 0;
int ask(vector<int> q) {
  int t = 0;
  if (q.size()) {
    cout << "? " << q.size() << " ";
    for (int i = (0); i < (q.size()); ++i) {
      cout << q[i] + 1 << " ";
    }
    cout << "\n";
    cout.flush();
    cin >> t;
  }
  return t;
}
vector<int> union1(int j, int k) {
  vector<int> ans;
  for (int i = (0); i < (n); ++i) {
    if ((i & (1 << j)) && (i & (1 << k))) {
      ans.push_back(i);
    }
  }
  return ans;
}
int count1(int size) {
  int res = 0;
  for (int i = (0); i < (size - 1); ++i) {
    res ^= x;
  }
  res ^= y;
  return res;
}
int main() {
  srand(time(nullptr));
  cin >> n >> x >> y;
  vector<int> res(10);
  vector<int> default_values(10);
  for (int j = (0); j < (10); ++j) {
    vector<int> q;
    for (int i = (0); i < (n); ++i) {
      if (i & (1 << j)) {
        q.push_back(i);
        default_values[j] ^= x;
      }
    }
    res[j] = ask(q);
  }
  int res1 = 0;
  int res2 = 0;
  int bit = -1;
  for (int j = (0); j < (10); ++j) {
    if (res[j] == y || res[j] == (x ^ y)) {
      bit = j;
    }
  }
  for (int j = (0); j < (10); ++j) {
    if (res[j] == y || res[j] == (x ^ y)) {
      res2 |= (1 << j);
      vector<int> tt = union1(j, bit);
      if (j != bit && ask(tt) != count1(tt.size())) {
        res1 ^= (1 << j);
        res2 ^= (1 << j);
      }
    } else {
      vector<int> tt = union1(j, bit);
      if (ask(tt) == count1(tt.size())) {
        res1 |= (1 << j);
        res2 |= (1 << j);
      }
    }
  }
  cout << "! " << res1 + 1 << " " << res2 + 1 << "\n";
}
