#include <bits/stdc++.h>
using namespace std;
long long n, x, y;
bool dif[12];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> x >> y;
  for (long long b = 0; b < 10; b++) {
    vector<long long> q;
    for (long long i = 1; i <= n; i++)
      if (i & (1 << b)) q.push_back(i);
    long long X;
    if (q.size()) {
      cout << "? " << q.size() << " ";
      for (long long i : q) cout << i << " ";
      cout << endl;
      cin >> X;
    } else
      X = 0;
    if ((q.size() & 1) * x == X)
      dif[b] = false;
    else
      dif[b] = true;
  }
  long long good;
  for (long long b = 0; b < 10; b++)
    if (dif[b]) good = b;
  vector<long long> q;
  for (long long i = 1; i <= n; i++)
    if (i & (1 << good)) q.push_back(i);
  while (q.size() > 1) {
    vector<long long> p;
    while (q.size() > p.size()) {
      p.push_back(q.back());
      q.pop_back();
    }
    long long X;
    if (p.size()) {
      cout << "? " << p.size() << " ";
      for (long long i : p) cout << i << " ";
      cout << endl;
      cin >> X;
    } else
      X = 0;
    if (X != 0 and X != x) q.swap(p);
  }
  long long A = q[0];
  long long B = A;
  for (long long b = 0; b < 10; b++)
    if (dif[b]) B ^= 1 << b;
  if (A > B) swap(A, B);
  cout << "! " << A << " " << B << endl;
  return 0;
}
