#include <bits/stdc++.h>
using namespace std;
int n, x, y, p1, p2;
vector<int> a, b;
int ask(const vector<int>& v) {
  printf("? %d ", (int)v.size());
  for (int i = 0; i < v.size(); ++i) {
    printf("%d", v[i]);
    if (i != v.size() - 1) printf(" ");
  }
  printf("\n");
  fflush(stdout);
  int res;
  scanf("%d", &res);
  return res;
}
int solveFor1(const vector<int>& v) {
  int st = 0, dr = v.size() - 1, mid, ans;
  while (st <= dr) {
    mid = (st + dr) / 2;
    vector<int> _asknow;
    for (int i = 0; i <= mid; ++i) _asknow.push_back(v[i]);
    int res = ask(_asknow);
    if (res == y || res == (x ^ y)) {
      ans = v[mid], dr = mid - 1;
    } else
      st = mid + 1;
  }
  return ans;
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  int posdiffer = 0, lastdif = 0;
  for (int i = 0; (1 << i) <= n; ++i) {
    vector<int> have;
    for (int j = 1; j <= n; ++j)
      if (j & (1 << i)) have.push_back(j);
    int res = ask(have);
    if (res == y || res == (x ^ y)) {
      posdiffer ^= 1 << i, lastdif = i;
    }
    assert(have.size());
  }
  for (int j = 1; j <= n; ++j)
    if (j & (1 << lastdif))
      a.push_back(j);
    else
      b.push_back(j);
  if (a.size() < b.size()) swap(a, b);
  p1 = solveFor1(a);
  p2 = p1 ^ posdiffer;
  if (p1 > p2) swap(p1, p2);
  printf("! %d %d\n", p1, p2);
  fflush(stdout);
  return 0;
}
