#include <bits/stdc++.h>
using namespace std;
int b[11] = {0};
vector<int> a[11];
int main() {
  int n, x, y, l, xr;
  scanf("%d %d %d", &n, &x, &y);
  l = log2(n);
  for (int i = 0; i <= l; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (j & (1 << i)) a[i].push_back(j);
    }
  }
  int m = 1000000007ll, id, c = 0, b = 0;
  for (int i = 0; i <= l; ++i) {
    int sz = a[i].size();
    printf("? %d ", sz);
    for (int j = 0; j < sz; ++j) printf("%d ", a[i][j]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &xr);
    if ((sz & 1) && xr == y) {
      b |= (1 << i);
      if (m != 1000000007ll) continue;
      m = min(sz, n - sz);
      id = i;
      c = ((m == sz) ? 1 : 0);
    } else if ((sz & 1) == 0 && xr == (x ^ y)) {
      b |= (1 << i);
      if (m != 1000000007ll) continue;
      m = min(sz, n - sz);
      id = i;
      c = ((m == sz) ? 1 : 0);
    }
  }
  for (int i = 0; i <= l; ++i) {
    a[i].clear();
    if (i == id) continue;
    for (int j = 1; j <= n; ++j) {
      if ((j & (1 << i)) && ((j >> id) & 1) == c) a[i].push_back(j);
    }
  }
  int p1 = (1 << id) * c, p2 = 0;
  for (int i = 0; i <= l; ++i) {
    if (i == id) continue;
    int sz = a[i].size();
    if (sz == 0) continue;
    printf("? %d ", sz);
    for (int j = 0; j < sz; ++j) printf("%d ", a[i][j]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &xr);
    if ((sz & 1) && xr == y)
      p1 += (1 << i);
    else if ((sz & 1) == 0 && xr == (x ^ y))
      p1 += (1 << i);
  }
  for (int i = 0; i <= l; ++i) {
    p2 = p1 ^ b;
  }
  if (p1 > p2) swap(p1, p2);
  printf("! %d %d\n", p1, p2);
  fflush(stdout);
  return 0;
}
