#include <bits/stdc++.h>
using namespace std;
int n, x, y, sum, mbit;
int Ask(vector<int> vec) {
  int ret = 0;
  printf("? %d ", vec.size());
  for (int i = 0; i < vec.size(); i++) printf("%d ", vec[i]);
  puts("");
  fflush(stdout);
  scanf("%d", &ret);
  return ret;
}
int Solve(vector<int> a) {
  vector<int> tmp;
  int l = 0, r = a.size() - 1, ans = 0;
  sort(a.begin(), a.end());
  while (l <= r) {
    int mid = (l + r) >> 1;
    for (int i = 0; i <= mid; i++) tmp.push_back(a[i]);
    int ret = Ask(tmp);
    tmp.clear();
    if (ret == y || ret == (y ^ x))
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  return a[ans];
}
int main() {
  vector<int> vec;
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 0; i <= 9; i++) {
    for (int j = 1; j <= n; j++)
      if (j >> i & 1) vec.push_back(j);
    if (!vec.size()) break;
    int ret = Ask(vec);
    vec.clear();
    if (ret == y || ret == (y ^ x)) sum |= (1 << i), mbit = i;
  }
  vector<int> ta, tb;
  for (int i = 1; i <= n; i++)
    if (i >> mbit & 1)
      ta.push_back(i);
    else
      tb.push_back(i);
  if (ta.size() > tb.size()) swap(ta, tb);
  int pos1 = Solve(ta), pos2 = (sum ^ pos1);
  if (pos1 > pos2) swap(pos1, pos2);
  printf("! %d %d\n", pos1, pos2);
  fflush(stdout);
  return 0;
}
