#include <bits/stdc++.h>
using namespace std;
int n, x, y, cnt1, pos;
int query(vector<int> a) {
  if (!a.size()) return 0;
  cout << "? " << a.size();
  for (int i = 0; i < a.size(); i++) cout << " " << a[i];
  puts("");
  fflush(stdout);
  int tmp;
  scanf("%d", &tmp);
  return tmp;
}
vector<int> a, b, c;
int main() {
  scanf("%d%d%d", &n, &x, &y);
  for (int i = 0; i < 10; i++) {
    a.clear();
    for (int j = 1; j <= n; j++)
      if (j & (1 << i)) a.push_back(j);
    int res = query(a);
    if (res == y || res == (x ^ y)) cnt1 |= (1 << i), pos = i;
  }
  a.clear(), b.clear();
  for (int i = 1; i <= n; i++) {
    if (i & (1 << pos))
      a.push_back(i);
    else
      b.push_back(i);
  }
  if (a.size() > b.size()) swap(a, b);
  int l = 0, r = a.size() - 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    c.clear();
    for (int i = l; i <= mid; i++) c.push_back(a[i]);
    int res = query(c);
    if (res == y || res == (x ^ y))
      r = mid;
    else
      l = mid + 1;
  }
  int ans1 = a[l], ans2 = a[l] ^ cnt1;
  if (ans1 > ans2) swap(ans1, ans2);
  printf("! %d %d\n", ans1, ans2);
  fflush(stdout);
  return 0;
}
