#include <bits/stdc++.h>
using namespace std;
const int MAXN = int(2e5);
const int MOD = int(360);
const int oo = INT_MAX;
const int P[] = {1, 3};
int n, x, y;
int query(vector<int> idxs) {
  if (int((idxs).size()) == 0) {
    return 0;
  }
  cout << "? " << int((idxs).size());
  for (auto& idx : idxs) {
    cout << ' ' << idx + 1;
  }
  cout << endl;
  int xr = 0;
  cin >> xr;
  return xr;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> x >> y;
  vector<int> groups[10];
  int ok = 0, tp = -1;
  for (int b = 0; b < 10; ++b) {
    for (int i = 0; i < n; ++i) {
      if ((i >> b) & 1) {
        groups[b].push_back(i);
      }
    }
    int xr = query(groups[b]);
    if (xr == (x ^ y) || xr == y) {
      ok |= (1 << b);
      tp = b;
    }
  }
  int lo = 0, hi = int((groups[tp]).size()) - 1;
  while (lo <= hi) {
    int mi = (lo + hi) >> 1;
    vector<int> cur_group;
    for (int i = 0; i <= mi; ++i) {
      cur_group.push_back(groups[tp][i]);
    }
    int xr = query(cur_group);
    if (xr == x || xr == 0) {
      lo = mi + 1;
    } else {
      hi = mi - 1;
    }
  }
  int ans1 = groups[tp][lo];
  int ans2 = ok ^ ans1;
  if (ans1 > ans2) {
    swap(ans1, ans2);
  }
  cout << "! " << ans1 + 1 << ' ' << ans2 + 1 << endl;
  return 0;
}
