#include <bits/stdc++.h>
using namespace std;
const int MX = 100500;
int n, x, y;
int xy;
bool check(vector<int> &a) {
  if (a.size() == 0) return false;
  cout << "? " << a.size();
  for (int i = 0; i < a.size(); i++) {
    cout << ' ' << a[i];
  }
  cout << endl;
  int ans;
  cin >> ans;
  return (ans == y) || (ans == xy);
}
bool check2(int mask) {
  vector<int> a;
  for (int j = 1; j <= n; j++) {
    if ((j & mask) == mask) a.push_back(j);
  }
  return check(a);
}
const int SZ = 10;
int b[SZ];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> x >> y;
  xy = x ^ y;
  for (int i = 0; i < SZ; i++) {
    if (check2(1 << i)) {
      b[i] = 1;
    }
  }
  int pos = 0;
  while (b[pos] == 0) pos++;
  int first_mask = 1 << pos;
  int second_mask = 0;
  for (int i = pos + 1; i < SZ; i++) {
    if (b[i] == 0) continue;
    if (check2(first_mask | (1 << i)))
      first_mask |= 1 << i;
    else
      second_mask |= 1 << i;
  }
  int add = 0;
  for (int i = 0; i < SZ; i++) {
    if (b[i]) continue;
    if (check2(first_mask | (1 << i))) add |= 1 << i;
  }
  first_mask |= add;
  second_mask |= add;
  if (first_mask > second_mask) swap(first_mask, second_mask);
  cout << "! " << first_mask << ' ' << second_mask << endl;
  return 0;
}
