#include <bits/stdc++.h>
using namespace std;
int X, Y;
bool query(vector<int> vec) {
  if (vec.size() == 0) return 1;
  cout << "? " << vec.size();
  for (auto x : vec) {
    cout << " " << x;
  }
  cout << endl;
  int t;
  cin >> t;
  return t == (vec.size() % 2 ? X : 0);
}
int main(int argc, char *argv[]) {
  int n;
  cin >> n >> X >> Y;
  int S = 0, p;
  for (int i = 9; i >= 0; i--) {
    vector<int> vec;
    for (int j = 1; j <= n; j++) {
      if (!(j & (1 << i))) {
        vec.push_back(j);
      }
    }
    if (query(vec)) {
      S ^= (1 << i);
    } else {
      p = i;
    }
  }
  int x = 0;
  for (int i = 9; i >= 0; i--) {
    if (i != p) {
      vector<int> vec;
      for (int j = 1; j <= n; j++) {
        if (!(j & (1 << p)) && !(j & (1 << i))) {
          vec.push_back(j);
        }
      }
      if (query(vec)) {
        x ^= (1 << i);
      }
    }
  }
  int y = x;
  for (int i = 9; i >= 0; i--) {
    if (!((1 << i) & S)) {
      y ^= (1 << i);
    }
  }
  if (x > y) swap(x, y);
  cout << "! " << x << " " << y << endl;
  return 0;
}
