#include <bits/stdc++.h>
using namespace std;
void pass() { return; }
const double EPS = 1e-6;
mt19937 rnd((rand() << 15 + rand()));
const long long MOD = 1e9 + 7;
const long long BIG_MOD = 1e18 + 7;
const long long MAXN = 1e5 + 7;
const long long BIT = 9;
long long x, y;
bool sovp[BIT + 1];
long long quer(vector<long long> q) {
  cout << "? ";
  cout << q.size() << ' ';
  for (long long x : q) {
    cout << x << ' ';
  }
  cout << endl;
  fflush(stdout);
  long long ans;
  cin >> ans;
  fflush(stdout);
  return ans;
}
long long find(vector<long long> a) {
  if (a.size() == 1) {
    return a[0];
  }
  long long n = a.size();
  long long l = (n - 1) / 2 + 1;
  vector<long long> first, second;
  for (long long i = 0; i < l; ++i) {
    first.push_back(a[i]);
  }
  for (long long i = l; i < n; ++i) {
    second.push_back(a[i]);
  }
  long long xor_ = quer(first);
  if (xor_ == 0 || xor_ == x) {
    return find(second);
  } else {
    return find(first);
  }
}
signed main() {
  long long n;
  cin >> n >> x >> y;
  long long p1 = -1;
  for (long long bt = 0; bt <= BIT; ++bt) {
    vector<long long> q0;
    for (long long i = 1; i <= n; ++i) {
      if (((i >> bt) & 1) == 0) {
        q0.push_back(i);
      }
    }
    long long xor_ = quer(q0);
    sovp[bt] = 1;
    if (xor_ != 0 && xor_ != x) {
      if (p1 == -1) p1 = find(q0);
      sovp[bt] = 0;
    }
  }
  long long p2 = 0;
  for (long long bt = 0; bt <= BIT; ++bt) {
    if (((p1 >> bt) & 1) && sovp[bt]) p2 += (1 << bt);
    if (!((p1 >> bt) & 1) && !sovp[bt]) p2 += (1 << bt);
  }
  if (p1 > p2) swap(p1, p2);
  cout << "! " << p1 << ' ' << p2 << endl;
  fflush(stdout);
  return 0;
  ;
  ;
}
