#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXLG = 9;
const int MAXN = 1 << (MAXLG + 1);
int n, x, y;
vector<int> q;
vector<int> qq;
map<vector<int>, bool> mem;
bool query() {
  qq.clear();
  for (int i = (0); i < (((int)(q).size())); ++i)
    if (0 <= q[i] && q[i] < n) qq.push_back(q[i]);
  if (((int)(qq).size()) == 0) return false;
  if (mem.count(qq)) return mem[qq];
  printf("? %d", ((int)(qq).size()));
  for (int i = (0); i < (((int)(qq).size())); ++i) printf(" %d", qq[i] + 1);
  puts("");
  fflush(stdout);
  int expect = ((int)(qq).size()) % 2 == 0 ? 0 : x;
  int actual;
  scanf("%d", &actual);
  bool ret = expect != actual;
  return mem[qq] = ret;
}
void run() {
  scanf("%d%d%d", &n, &x, &y);
  vector<bool> diff(MAXLG + 1);
  for (int i = (0); i <= (MAXLG); ++i) {
    q.clear();
    for (int j = (0); j < (MAXN); ++j)
      if (((j >> i) & 1) == 0) q.push_back(j);
    diff[i] = query();
  }
  vector<int> fix(MAXLG + 1, -1);
  for (int i = (0); i <= (MAXLG); ++i)
    if (diff[i]) {
      fix[i] = 0;
      break;
    }
  for (int i = (0); i <= (MAXLG); ++i)
    if (fix[i] == -1) {
      q.clear();
      fix[i] = 0;
      for (int j = (0); j < (MAXN); ++j) {
        bool ok = true;
        for (int k = (0); k <= (MAXLG); ++k)
          if (fix[k] != -1 && ((j >> k) & 1) != fix[k]) ok = false;
        if (ok) q.push_back(j);
      }
      fix[i] = query() ? 0 : 1;
    }
  int a = 0;
  for (int i = (0); i <= (MAXLG); ++i)
    if (fix[i] == 1) a |= 1 << i;
  int b = a;
  for (int i = (0); i <= (MAXLG); ++i)
    if (diff[i]) b ^= 1 << i;
  if (a > b) swap(a, b);
  printf("! %d %d\n", a + 1, b + 1);
  fflush(stdout);
}
int main() {
  run();
  return 0;
}
