#include <bits/stdc++.h>
using namespace std;
int b[11];
int sz[11];
vector<int> q;
int n, x, y;
int solve() {
  int lo = 0, hi = q.size() - 1, res = 0;
  if (lo == hi) return q[lo];
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    int sz = (mid - lo + 1);
    printf("? ");
    printf("%d ", sz);
    for (int j = lo; j <= mid; j++) {
      printf("%d ", q[j]);
    }
    printf("\n");
    fflush(stdout);
    int a;
    scanf("%d", &a);
    if ((sz % 2 == 0 && a == (x ^ y)) || (sz % 2 == 1 && a == y)) {
      hi = mid;
    } else {
      lo = mid + 1;
    }
    if (lo == hi) {
      res = q[lo];
      break;
    }
  }
  return res;
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  int ans1 = 0, ans2 = 0;
  bool ok = 0;
  for (int i = 0; i < 10; i++) {
    q.clear();
    for (int j = 1; j <= n; j++)
      if ((j >> i) & 1) q.push_back(j);
    if (q.size() == 0) continue;
    printf("? ");
    printf("%d ", q.size());
    for (int j = 0; j < q.size(); j++) printf("%d ", q[j]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &b[i]);
    sz[i] = q.size();
    if (!ok) {
      if ((sz[i] % 2 == 0 && b[i] == (x ^ y)) ||
          (sz[i] % 2 == 1 && b[i] == y)) {
        ok = 1;
        ans1 = solve();
      }
    }
  }
  for (int i = 0; i < 10; i++) {
    if ((ans1 >> i) & 1) {
      if ((sz[i] % 2 == 0 && b[i] == 0) || (sz[i] % 2 == 1 && b[i] == x)) {
        ans2 += (1 << i);
      }
    } else {
      if ((sz[i] % 2 == 0 && b[i] == (x ^ y)) ||
          (sz[i] % 2 == 1 && b[i] == y)) {
        ans2 += (1 << i);
      }
    }
  }
  if (ans1 > ans2) swap(ans1, ans2);
  printf("! %d %d\n", ans1, ans2);
  fflush(stdout);
}
