#include <bits/stdc++.h>
using namespace std;
using lint = long long;
int n, x, y;
bool ask_1y(const vector<int>& a) {
  if (a.empty()) {
    return false;
  }
  cout << "? " << a.size();
  for (int i : a) {
    cout << " " << i + 1;
  }
  cout << endl;
  int r;
  cin >> r;
  return r == y || r == (x ^ y);
}
bool same[11];
void solve(istream& cin, ostream& cout) {
  cin >> n >> x >> y;
  int hb = -1;
  for (int i = 0; i < 10; i++) {
    vector<int> a;
    for (int j = (0); j < int(n); ++j) {
      if ((((j) >> (i)) & 1)) {
        a.push_back(j);
      }
    }
    if (ask_1y(a)) {
      hb = i;
    } else {
      same[i] = true;
    }
  }
  int a = 0;
  int b = 0;
  for (int i = 0; i < 10; i++) {
    if (i == hb) {
      b |= (1 << (hb));
      continue;
    }
    vector<int> v;
    for (int j = (0); j < int(n); ++j) {
      if (!(((j) >> (i)) & 1) && !(((j) >> (hb)) & 1)) {
        v.push_back(j);
      }
    }
    if (ask_1y(v)) {
      if (!same[i]) {
        b |= (1 << (i));
      }
    } else {
      a |= (1 << (i));
      if (same[i]) {
        b |= (1 << (i));
      }
    }
  }
  cout << "! " << a + 1 << " " << b + 1 << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve(cin, cout);
  return 0;
}
