#include <bits/stdc++.h>
using namespace std;
template <class T>
T gi() {
  T x = 0;
  bool f = 0;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = 1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f ? -x : x;
}
int query(vector<int> &a) {
  int res = 0;
  if (a.size()) {
    printf("? %d", a.size());
    for (auto i : a) printf(" %d", i);
    puts("");
    cin >> res;
  }
  return res;
}
int n, x, y;
int find(vector<int> &a, int l, int r) {
  if (l == r) return a[l];
  int mid = (l + r) >> 1;
  vector<int> v;
  for (int i = l; i <= mid; i++) v.push_back(a[i]);
  int t = query(v);
  if (t == y || t == (x ^ y)) return find(a, l, mid);
  return find(a, mid + 1, r);
}
int main() {
  n = gi<int>(), x = gi<int>(), y = gi<int>();
  int xr = 0, tmp = 0;
  for (int i = 0; i < 10; i++) {
    vector<int> a;
    for (int j = 1; j <= n; j++)
      if (j & 1 << i) a.push_back(j);
    int t = query(a);
    if (t == y || t == (x ^ y)) {
      xr |= 1 << i;
      tmp = i;
    }
  }
  vector<int> a, b;
  for (int i = 1; i <= n; i++)
    if (i & 1 << tmp)
      a.push_back(i);
    else
      b.push_back(i);
  if (a.size() > b.size()) swap(a, b);
  int p = find(a, 0, a.size() - 1);
  xr ^= p;
  if (p > xr) swap(p, xr);
  fflush(stdout);
  printf("! %d %d\n", p, xr);
  return 0;
}
