#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int ans1, ans2;
vector<int> sett0[11], sett1[11];
bool diff[11];
int ask(int s, int c, vector<int> &v) {
  cout << "? " << (c - s + 1);
  for (long long i = s; i <= c; ++i) {
    cout << " " << v[i];
  }
  cout << '\n';
  cout.flush();
  int ret;
  cin >> ret;
  return ret;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> x >> y;
  for (long long bit = 0; bit <= 10; ++bit) {
    for (long long i = 1; i <= n; ++i) {
      if (i & (1 << bit)) {
        sett1[bit].push_back(i);
      } else {
        sett0[bit].push_back(i);
      }
    }
    if (sett1[bit].empty()) continue;
    int ret = ask(0, sett1[bit].size() - 1, sett1[bit]);
    if ((sett1[bit].size() % 2 == 0 && ret == (x ^ y)) ||
        (sett1[bit].size() % 2 && ret == y)) {
      diff[bit] = true;
    }
  }
  for (long long bit = 0; bit <= 10; ++bit) {
    if (diff[bit]) {
      if (sett1[bit].size() <= sett0[bit].size()) {
        int L = 0, R = sett1[bit].size() - 1;
        while (R - L > 0) {
          int M = (R + L) >> 1;
          int ret = ask(L, M, sett1[bit]);
          if (((M - L + 1) % 2 == 0 && ret == (x ^ y)) ||
              ((M - L + 1) % 2 && ret == y)) {
            R = M;
          } else {
            L = M + 1;
          }
        }
        ans1 = sett1[bit][L];
      } else {
        int L = 0, R = sett0[bit].size() - 1;
        while (R - L > 0) {
          int M = (R + L) >> 1;
          int ret = ask(L, M, sett0[bit]);
          if (((M - L + 1) % 2 == 0 && ret == (x ^ y)) ||
              ((M - L + 1) % 2 && ret == y)) {
            R = M;
          } else {
            L = M + 1;
          }
        }
        ans1 = sett0[bit][L];
      }
      break;
    }
  }
  ans2 = ans1;
  for (long long bit = 0; bit <= 10; ++bit) {
    if (diff[bit]) {
      if (ans1 & (1 << bit)) {
        ans2 = ans2 ^ (1 << bit);
      } else {
        ans2 = ans2 | (1 << bit);
      }
    }
  }
  if (ans1 > ans2) swap(ans1, ans2);
  cout << "! " << ans1 << " " << ans2 << '\n';
  cout.flush();
}
