#include <bits/stdc++.h>
using namespace std;
int N, x, y;
vector<int> tmp;
int p1, p2, val;
int main() {
  cin >> N >> x >> y;
  int bit = 0;
  for (; bit < 10; bit++) {
    for (int i = 1; i <= N; i++)
      if (i & (1 << bit)) tmp.push_back(i);
    if (tmp.empty()) continue;
    cout << "? ";
    cout << tmp.size() << " ";
    for (auto it : tmp) cout << it << " ";
    cout << endl;
    tmp.clear();
    cin >> val;
    if (val == y || val == (x ^ y)) break;
  }
  p1 = 1 << bit;
  for (int i = 0; i < 10; i++)
    if (i != bit) {
      for (int j = 1; j <= N; j++)
        if ((j & (1 << i)) && (j & (1 << bit))) tmp.push_back(j);
      if (tmp.empty()) continue;
      cout << "? ";
      cout << tmp.size() << " ";
      for (auto it : tmp) cout << it << " ";
      cout << endl;
      tmp.clear();
      cin >> val;
      if (val == y || val == (x ^ y)) p1 |= (1 << i);
    }
  p2 |= (p1 & ((1 << bit) - 1));
  for (int i = bit + 1; i < 10; i++) {
    for (int j = 1; j <= N; j++)
      if ((j & (1 << i)) && !(j & (1 << bit))) tmp.push_back(j);
    if (tmp.empty()) continue;
    cout << "? ";
    cout << tmp.size() << " ";
    for (auto it : tmp) cout << it << " ";
    cout << endl;
    tmp.clear();
    cin >> val;
    if (val == y || val == (x ^ y)) p2 |= (1 << i);
  }
  if (p1 > p2) swap(p1, p2);
  cout << "! " << p1 << " " << p2 << endl;
  return 0;
}
