#include <bits/stdc++.h>
using namespace std;
int n, x, y;
vector<int> sub(vector<int> v, int st, int en) {
  vector<int> ret;
  for (int i = st; i < en; ++i) ret.push_back(v[i]);
  return ret;
}
vector<int> calc(vector<int> v) {
  while (v.size() > 1) {
    cout << "? " << v.size() / 2;
    for (int i = 0; i < v.size() / 2; ++i) cout << " " << v[i];
    cout << endl;
    fflush(stdout);
    int a;
    cin >> a;
    if (a == 0 || a == x)
      v = sub(v, v.size() / 2, v.size());
    else
      v = sub(v, 0, v.size() / 2);
  }
  return v;
}
int main() {
  cin >> n >> x >> y;
  for (int i = 9; i >= 0; --i) {
    vector<int> v;
    for (int j = 1; j <= n; ++j) {
      if (j & (1 << i)) continue;
      v.push_back(j);
    }
    cout << "? " << v.size();
    for (auto z : v) cout << " " << z;
    cout << endl;
    fflush(stdout);
    int a;
    cin >> a;
    if (a == 0 || a == x) continue;
    v = calc(v);
    int s1 = v[0], s2 = v[0];
    v.clear();
    for (int i1 = i; i1 >= 0; --i1) {
      if (s2 & (1 << i1)) s2 ^= (1 << i1);
    }
    s2 += (1 << i);
    for (int j = s2; j < s2 + (1 << i) && j <= n; ++j)
      if (j != s1) v.push_back(j);
    v = calc(v);
    cout << "! " << s1 << " " << v[0];
    cout << endl;
    fflush(stdout);
    return 0;
  }
}
