#include <bits/stdc++.h>
using namespace std;
int N, X, Y, Xor, hb;
int query(vector<int> vec) {
  if (!vec.size()) return 0;
  printf("? %lu", vec.size());
  for (auto i : vec) printf(" %d", i);
  putchar('\n');
  fflush(stdout);
  int res = 0;
  return scanf("%d", &res), res;
}
int main() {
  cin >> N >> X >> Y;
  for (int i = 0; i < 10; i++) {
    vector<int> vec;
    for (int j = 1; j <= N; j++)
      if (j >> i & 1) vec.push_back(j);
    int res = query(vec);
    if (res == Y || res == (X ^ Y)) Xor |= (1 << i), hb = i;
  }
  vector<int> a, b;
  for (int i = 1; i <= N; i++)
    if (i >> hb & 1)
      a.push_back(i);
    else
      b.push_back(i);
  if (a.size() > b.size()) swap(a, b);
  int l = 0, r = a.size() - 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    vector<int> c;
    for (int i = l; i <= mid; i++) c.push_back(a[i]);
    int res = query(c);
    if (res == Y || res == (X ^ Y))
      r = mid;
    else
      l = mid + 1;
  }
  int a1 = a[l], a2 = a1 ^ Xor;
  if (a1 > a2) swap(a1, a2);
  printf("! %d %d\n", a1, a2);
  fflush(stdout);
  return 0;
}
