#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et() {
  puts("-1");
  exit(0);
}
vector<int> q[10], rq[10];
bool diff[10];
int x, y;
int rd(vector<int> &q, int st, int ed) {
  printf("? %d", ed - st);
  for (int i = st; i < ed; i++) printf(" %d", q[i]);
  puts("");
  fflush(stdout);
  int z;
  scanf("%d", &z);
  return z;
}
int qy(vector<int> &q) {
  int l = 0, r = q.size();
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    int ans = rd(q, l, mid);
    bool ok = ((mid - l) % 2 == 1 && ans == y);
    ok |= ((mid - l) % 2 == 0 && ans == (y ^ x));
    if (ok)
      r = mid;
    else
      l = mid;
  }
  return q[l];
}
void fmain(int tid) {
  scanf("%d%d%d", &n, &x, &y);
  int N = 0;
  for (int t = n; t > 0; t >>= 1) N++;
  for (int(j) = 0; (j) < (int)(N); (j)++) {
    for (int(i) = 1; (i) <= (int)(n); (i)++)
      if ((i >> j) & 1) {
        q[j].push_back(i);
      } else
        rq[j].push_back(i);
    int z = rd(q[j], 0, (int)q[j].size());
    if (q[j].size() % 2 == 1) {
      if (z == y) diff[j] = 1;
    } else {
      if (z == (x ^ y)) diff[j] = 1;
    }
  }
  int A = 0, B = 0;
  for (int(j) = 0; (j) < (int)(N); (j)++)
    if (diff[j]) {
      if (rq[j].size() < q[j].size()) {
        A = qy(rq[j]);
      } else
        A = qy(q[j]);
      break;
    }
  for (int(j) = 0; (j) < (int)(N); (j)++) {
    int num = (A >> j) & 1;
    if (diff[j]) num ^= 1;
    B |= num << j;
  }
  if (B < A) swap(A, B);
  printf("! %d %d\n", A, B);
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
