#include <bits/stdc++.h>
using namespace std;
int n, x, y;
void ask(vector<int> &v) {
  cout << "?";
  printf(" %d", (int)v.size());
  for (int i = 0; i < v.size(); i++) {
    printf(" %d", v[i]);
  }
  cout << endl;
  fflush(stdout);
}
int answer() {
  int num;
  cin >> num;
  return num;
}
int bit;
vector<pair<int, int> > cand;
int main() {
  scanf("%d %d %d", &n, &x, &y);
  for (int i = 0; (1 << i) <= n; i++) {
    vector<int> tmp;
    for (int j = 1; j <= n; j++) {
      if (j & (1 << i)) {
        tmp.push_back(j);
      }
    }
    ask(tmp);
    int cur = answer();
    if (cur == y || cur == (x ^ y)) {
      bit |= (1 << i);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i < (i ^ bit)) {
      cand.push_back(make_pair(i, i ^ bit));
    }
  }
  int L = 0, R = (int)cand.size() - 1;
  while (L <= R) {
    if (L == R) {
      printf("! %d %d\n", cand[L].first, cand[L].second);
      return 0;
    }
    int mid = (L + R) >> 1;
    vector<int> tmp;
    for (int i = L; i <= mid; i++) {
      tmp.push_back(cand[i].first);
    }
    ask(tmp);
    int cur = answer();
    if (cur == y || cur == (x ^ y)) {
      R = mid;
    } else {
      L = mid + 1;
    }
  }
}
