#include <bits/stdc++.h>
using namespace std;
const long long INF = 2000000000000000;
int n, x, y;
int k = 0;
bool odd;
bool getBit(int v, int bit) { return (v >> bit) & 1; }
void changeBit(int &v, int bit) { v ^= 1 << bit; }
bool testBit(int bit) {
  vector<int> z;
  for (int i = 1; i <= n; ++i)
    if (getBit(i, bit)) z.push_back(i);
  if (z.size() == 0) return false;
  printf("? %i ", (int)z.size());
  for (int v : z) printf("%i ", v);
  printf("\n");
  fflush(stdout);
  int resp;
  scanf("%i", &resp);
  bool res = getBit(resp, k);
  if (odd)
    return res != (bool)(z.size() & 1);
  else
    return res;
}
bool sumPref(const vector<int> &subSet, int pos) {
  int len = pos + 1;
  printf("? %i ", len);
  for (int i = 0; i < len; ++i) printf("%i ", subSet[i]);
  printf("\n");
  fflush(stdout);
  int resp;
  scanf("%i", &resp);
  if (resp == -1) exit(0);
  bool res = getBit(resp, k);
  if (odd)
    return res != (bool)(len & 1);
  else
    return res;
}
int binSearch(const vector<int> &sub) {
  int l = -1, r = (int)sub.size() - 1;
  while (r - l > 1) {
    int m = (l + r) >> 1;
    if (sumPref(sub, m))
      r = m;
    else
      l = m;
  }
  return sub[r];
}
int main() {
  vector<int> difBit;
  scanf("%i %i %i", &n, &x, &y);
  while ((x & 1) == (y & 1)) {
    x >>= 1;
    y >>= 1;
    ++k;
  }
  odd = x & 1;
  for (int bit = 0; bit < 10; ++bit)
    if (testBit(bit)) difBit.push_back(bit);
  fprintf(stderr, "-----\n");
  vector<int> pos;
  for (int i = 1; i <= n; ++i)
    if (getBit(i, difBit[0])) pos.push_back(i);
  int res1 = binSearch(pos);
  int res2 = res1;
  for (int v : difBit) changeBit(res2, v);
  if (res1 > res2) swap(res1, res2);
  printf("! %i %i", res1, res2);
  fflush(stdout);
  return 0;
}
