#include <bits/stdc++.h>
using namespace std;
int n, x, y, differ = 0, differbit = -1;
vector<int> a;
vector<int> b;
int ask() {
  if (a.empty()) return 0;
  printf("? %d", a.size());
  for (int i = 0; i < a.size(); ++i) printf(" %d", a[i]);
  puts("");
  fflush(stdout);
  int res;
  scanf("%d", &res);
  return res;
}
int solve() {
  int l = 0, r = b.size() - 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    a.clear();
    for (int i = l; i <= mid; ++i) a.push_back(b[i]);
    int res = ask();
    if (res == y || res == (x ^ y))
      r = mid;
    else
      l = mid + 1;
  }
  return b[l];
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 0; (1 << i) <= n; ++i) {
    a.clear();
    for (int j = 1; j <= n; ++j)
      if (j & (1 << i)) a.push_back(j);
    int res = ask();
    if (res == y || res == (x ^ y)) differ |= (1 << i), differbit = i;
  }
  a.clear();
  for (int i = 1; i <= n; ++i) {
    if (i & (1 << differbit))
      a.push_back(i);
    else
      b.push_back(i);
  }
  if (a.size() < b.size()) swap(a, b);
  int pos1 = solve();
  int pos2 = pos1 ^ differ;
  if (pos1 > pos2) swap(pos1, pos2);
  printf("! %d %d\n", pos1, pos2);
  return 0;
}
