#include <bits/stdc++.h>
using namespace std;
map<vector<int>, int> used;
inline int ask(vector<int> gg) {
  if (used.count(gg)) {
    return used[gg];
  }
  if (gg.size() == 0) {
    return 0;
  }
  printf("? %d ", (int)gg.size());
  for (int g : gg) {
    printf("%d ", g);
  }
  printf("\n");
  fflush(stdout);
  int ret;
  scanf("%d", &ret);
  if (ret == -1) {
    exit(0);
  }
  return used[gg] = ret;
}
int n, x, y;
int bit[11];
int main() {
  scanf("%d%d%d", &n, &x, &y);
  vector<int> temp1;
  for (int i = 0; i < 10; ++i) {
    vector<int> fir;
    vector<int> sec;
    for (int j = 1; j <= n; ++j) {
      if (j & (1 << i)) {
        fir.push_back(j);
      } else {
        sec.push_back(j);
      }
    }
    int v = ask(fir);
    if (v == x || v == 0) {
      bit[i] = 1;
    } else {
      if (fir.size() < sec.size()) {
        temp1 = fir;
      } else {
        temp1 = sec;
      }
    }
  }
  int L = -1;
  int R = temp1.size() - 1;
  int M;
  while (L + 1 != R) {
    M = (L + R) / 2;
    vector<int> gg;
    for (int i = 0; i <= M; ++i) {
      gg.push_back(temp1[i]);
    }
    int v = ask(gg);
    if (v == y || v == (y ^ x)) {
      R = M;
    } else {
      L = M;
    }
  }
  R = temp1[R];
  int an = 0;
  for (int i = 0; i < 10; ++i) {
    if (!bit[i]) {
      if (!(R & (1 << i))) {
        an += (1 << i);
      }
    } else {
      if (R & (1 << i)) {
        an += (1 << i);
      }
    }
  }
  if (an > R) {
    swap(an, R);
  }
  printf("! %d %d\n", an, R);
  fflush(stdout);
}
