#include <bits/stdc++.h>
const int inf = (1ll << 30) - 1;
const int maxn = (int)1e5 + 10;
using namespace std;
int n, x, y;
int bi = 0;
int lg = 0;
int out(vector<int> v) {
  cout << "? " << v.size();
  for (__typeof(v.begin()) it = v.begin(); it != v.end(); it++) {
    cout << " " << (*it) + 1;
  }
  cout << endl;
  int res;
  cin >> res;
  return res;
}
int get(vector<int> v) {
  int res = 0;
  for (int i = 0; i < v.size(); i++) res ^= x;
  return res;
}
void solve() {
  cin >> n >> x >> y;
  while ((1 << lg) < n) lg++;
  lg--;
  while (!((x ^ y) & (1 << bi))) {
    bi++;
  }
  int ans = 0;
  for (int i = 0; i < n - 2; i++) ans ^= x;
  int d = -1;
  int same = 0;
  for (int i = 0; i <= lg; i++) {
    vector<int> v;
    for (int j = 0; j < n; j++) {
      if (j & (1 << i)) v.push_back(j);
    }
    int res = out(v);
    if (res != get(v)) {
      same |= (1 << i);
      d = i;
    }
  }
  vector<int> res;
  for (int i = 0; i < n; i++) {
    if (i & (1 << d)) res.push_back(i);
  }
  while (res.size() > 1) {
    vector<int> nres;
    random_shuffle(res.begin(), res.end());
    while (res.size() > nres.size()) {
      nres.push_back(res.back());
      res.pop_back();
    }
    int d = out(res);
    if (d == get(res)) {
      res = nres;
    }
  }
  int A = res[0];
  int B = res[0] ^ same;
  if (A > B) swap(A, B);
  cout << "! " << A + 1 << " " << B + 1 << endl;
}
int main() {
  int t = 1;
  for (int i = 1; i <= t; i++) {
    solve();
  }
  return 0;
}
