#include <bits/stdc++.h>
using namespace std;
int n, total, fl, chk;
int expect(int tot) { return (tot % 2) * fl; }
int ask_xorval(int pos) {
  vector<int> all;
  for (int i = 1; i <= n; i++)
    if (i & (1 << pos)) all.push_back(i);
  total = all.size();
  if (all.size() == 0) return 0;
  printf("? %d", all.size());
  for (int i = 0; i < all.size(); i++) printf(" %d", all[i]);
  printf("\n");
  fflush(stdout);
  int x;
  scanf("%d", &x);
  return !!(x & (1 << chk));
}
bool isit(vector<int> &vec) {
  printf("? %d", vec.size());
  for (int i = 0; i < vec.size(); i++) printf(" %d", vec[i]);
  printf("\n");
  fflush(stdout);
  int x;
  scanf("%d", &x);
  x = !!(x & (1 << chk));
  return expect(vec.size()) == x;
}
vector<int> answer;
void calc(vector<int> &valid) {
  if (valid.size() == 1) {
    answer.push_back(valid[0]);
    return;
  }
  int mid = valid.size() / 2, i;
  vector<int> lft, rgt;
  for (i = 0; i < mid; i++) lft.push_back(valid[i]);
  for (; i < valid.size(); i++) rgt.push_back(valid[i]);
  if (isit(lft))
    calc(rgt);
  else
    calc(lft);
}
int main() {
  int x, y, i;
  scanf("%d", &n);
  scanf("%d", &x);
  scanf("%d", &y);
  for (i = 0; i < 32; i++)
    if ((x & (1 << i)) != (y & (1 << i))) break;
  fl = !!(x & (1 << i));
  chk = i;
  for (i = 0; i < 10; i++) {
    int val = ask_xorval(i);
    if (expect(total) != val) break;
  }
  vector<int> tmp;
  int err = i;
  for (i = 1; i <= n; i++)
    if (i & (1 << err)) tmp.push_back(i);
  calc(tmp);
  tmp.clear();
  for (i = 1; i <= n; i++) {
    int xx = answer[0], ttt = i;
    xx &= ((1 << err) - 1);
    ttt &= ((1 << err) - 1);
    if (xx == ttt && (i & (1 << err)) != (answer[0] & (1 << err)))
      tmp.push_back(i);
  }
  calc(tmp);
  sort(answer.begin(), answer.end());
  printf("! %d %d\n", answer[0], answer[1]);
  fflush(stdout);
  return 0;
}
