#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using db = double;
int n;
int x, y;
bool ask(int x, int s) {
  vi p;
  for (int i = 1; i <= n; ++i)
    if ((i & s) == x) p.push_back(i);
  if (p.empty() || p.size() == n) return false;
  printf("? %d ", int(p.size()));
  int w = 0;
  for (auto i : p) {
    printf("%d ", i);
    w ^= ::x;
  }
  puts("");
  fflush(stdout);
  int t;
  cin >> t;
  return t != w;
}
bool d[10];
int main() {
  cin >> n >> x >> y;
  for (int i = 0; i < 10; ++i) d[i] = ask((1 << (i)), (1 << (i)));
  int p = find(d, d + 10, true) - d;
  int a = 0, b = (1 << (p)), s = (1 << (p));
  for (int i = 0; i < 10; ++i)
    if (i != p) {
      s |= (1 << (i));
      if (d[i]) {
        if (ask(a | (1 << (i)), s))
          a |= (1 << (i));
        else
          b |= (1 << (i));
      } else {
        if (ask(a | (1 << (i)), s))
          a |= (1 << (i)), b |= (1 << (i));
        else
          ;
      }
    }
  cout << "! " << min(a, b) << ' ' << max(a, b) << endl;
  fflush(stdout);
}
