#include <bits/stdc++.h>
using namespace std;
const int maxB = 10;
int n, x, y, diff, first;
int main() {
  cin >> n >> x >> y;
  int piv = -1;
  for (int i = 0; i < maxB; i++) {
    vector<int> v;
    for (int j = 1; j <= n; j++)
      if (j >> i & 1) v.push_back(j);
    if ((int)v.size() == 0) continue;
    cout << "? " << (int)v.size() << ' ';
    for (int j = 0; j < (int)v.size(); j++) cout << v[j] << ' ';
    cout << endl << flush;
    int ans, exp = ((int)v.size() % 2) * x;
    cin >> ans;
    if (ans == -1) exit(0);
    if (ans != exp) {
      diff ^= (1 << i);
      piv = i;
    }
  }
  first ^= (1 << piv);
  for (int i = 0; i < maxB; i++)
    if (i != piv) {
      vector<int> v;
      for (int j = 1; j <= n; j++)
        if ((j >> i & 1) && (j >> piv & 1)) v.push_back(j);
      if ((int)v.size() == 0) continue;
      cout << "? " << (int)v.size() << ' ';
      for (int j = 0; j < (int)v.size(); j++) cout << v[j] << ' ';
      cout << endl << flush;
      int ans, exp = ((int)v.size() % 2) * x;
      cin >> ans;
      if (ans == -1) exit(0);
      if (ans != exp) first ^= (1 << i);
    }
  int second = first ^ diff;
  if (second < first) swap(first, second);
  cout << "! " << first << ' ' << (first ^ diff) << endl;
  return 0;
}
