#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  cin >> n >> x >> y;
  int xy = x ^ y;
  int idbit;
  bool dif[10];
  memset(dif, 0, sizeof dif);
  for (int bit = 0; bit < 10; ++bit) {
    int chknum = (1 << bit);
    vector<int> que;
    for (int j = 1; j <= n; ++j) {
      if (j & chknum) que.push_back(j);
    }
    if (que.size()) {
      cout << "? " << que.size();
      for (int j = 0; j < que.size(); ++j) cout << " " << que[j];
      cout << endl;
      fflush(stdout);
      int res;
      cin >> res;
      if (res == y || res == xy) {
        dif[bit] = 1;
        idbit = bit;
      }
    }
  }
  int ans1 = 0;
  int ans2 = (1 << idbit);
  for (int bit = 0; bit < 10; ++bit) {
    if (bit == idbit) continue;
    int chknum = (1 << bit);
    int chknum2 = (1 << idbit);
    vector<int> que;
    for (int j = 1; j <= n; ++j) {
      if ((j & chknum) && ((j & chknum2) == 0)) que.push_back(j);
    }
    if (que.size()) {
      cout << "? " << que.size();
      for (int j = 0; j < que.size(); ++j) cout << " " << que[j];
      cout << endl;
      fflush(stdout);
      int res;
      cin >> res;
      if (res == y || res == xy) {
        if (dif[bit]) {
          ans1 += (1 << bit);
        } else {
          ans2 += (1 << bit);
          ans1 += (1 << bit);
        }
      } else {
        if (dif[bit]) {
          ans2 += (1 << bit);
        }
      }
    }
  }
  cout << "! " << ans1 << " " << ans2 << endl;
  fflush(stdout);
  return 0;
}
