#include <bits/stdc++.h>
using namespace std;
bool match[10];
int main() {
  ios::sync_with_stdio(0);
  int n, x, y;
  cin >> n >> x >> y;
  int b = 0;
  while ((1 << b) <= n) b++;
  for (int i = 0; i < b; i++) {
    vector<int> v;
    for (int j = 1; j <= n; j++)
      if (j & (1 << i)) v.push_back(j);
    cout << "? " << v.size();
    for (int asd : v) cout << " " << asd;
    cout << endl;
    fflush(stdout);
    int ans;
    cin >> ans;
    if (ans == -1) exit(0);
    if (v.size() % 2 == 0) {
      if (ans == 0) match[i] = 1;
    } else {
      if (ans == x) match[i] = 1;
    }
  }
  int a1;
  for (int i = 0; i < b; i++)
    if (match[i] == 0) {
      vector<int> v;
      for (int j = 1; j <= n; j++)
        if (j & (1 << i)) v.push_back(j);
      if (2 * v.size() > n) {
        v.clear();
        for (int j = 1; j <= n; j++)
          if ((j & (1 << i)) == 0) v.push_back(j);
      }
      while (v.size() > 1) {
        vector<int> test;
        for (int j = 0; 2 * j < v.size(); j++) test.push_back(v[j]);
        cout << "? " << test.size();
        for (int asd : test) cout << " " << asd;
        cout << endl;
        fflush(stdout);
        int ans;
        cin >> ans;
        if (ans == -1) exit(0);
        bool keep = false;
        if (test.size() % 2 == 0) {
          if (ans == (x ^ y)) keep = true;
        } else {
          if (ans == y) keep = true;
        }
        if (!keep) {
          test.clear();
          for (int j = 0; j < v.size(); j++)
            if (2 * j >= v.size()) test.push_back(v[j]);
        }
        v.clear();
        for (int asd : test) v.push_back(asd);
      }
      a1 = v[0];
      break;
    }
  int a2 = 0;
  for (int i = 0; i < b; i++) {
    if (match[i])
      a2 += a1 & (1 << i);
    else
      a2 += ((1 << i) - (a1 & (1 << i)));
  }
  cout << "! " << min(a1, a2) << " " << max(a1, a2) << endl;
  fflush(stdout);
  return 0;
}
