#include <bits/stdc++.h>
using namespace std;
int n, y, x, bitsForOne, bitChoose;
int ask(vector<int>& a) {
  if (a.size() == 0) return 0;
  printf("? %d", (int)a.size());
  for (int v : a) printf(" %d", v);
  puts("");
  fflush(stdout);
  int ret;
  scanf("%d", &ret);
  return ret;
}
int binary(vector<int>& a) {
  int l = 0, r = a.size() - 1;
  while (l < r) {
    vector<int> v;
    int mid = l + r >> 1;
    for (int i = 0; i <= mid; ++i) v.push_back(a[i]);
    int ret = ask(v);
    if (!(ret == y || ret == (y ^ x)))
      l = mid + 1;
    else
      r = mid;
  }
  return a[l];
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (int bits = 0; bits <= 9; ++bits) {
    vector<int> a;
    for (int i = 1; i <= n; ++i) {
      if (i & (1 << bits)) a.push_back(i);
    }
    int ret = ask(a);
    if (ret == y || ret == (y ^ x)) {
      bitsForOne |= 1 << bits;
      bitChoose = bits;
    }
  }
  vector<int> a, b;
  for (int i = 1; i <= n; ++i) {
    if (i & (1 << bitChoose))
      a.push_back(i);
    else
      b.push_back(i);
  }
  if (a.size() > b.size()) std::swap(a, b);
  int p1 = binary(a), p2;
  p2 ^= p1 ^ bitsForOne;
  if (p1 > p2) std::swap(p1, p2);
  printf("! %d %d\n", p1, p2);
  fflush(stdout);
  return 0;
}
