#include <bits/stdc++.h>
using namespace std;
template <typename T>
void _R(T &x) {
  cin >> x;
}
template <typename T>
void _R(vector<T> &x) {
  for (auto it = x.begin(); it != x.end(); it++) {
    _R(*it);
  }
}
void R() {}
template <typename T, typename... K>
void R(T &head, K &...tail) {
  _R(head);
  R(tail...);
}
template <typename T>
void _W(const T &x, const char c) {
  cout << x;
}
template <typename T>
void _W(const vector<T> &x, const char c) {
  for (auto it = x.cbegin(); it != x.cend(); it++) {
    if (it != x.cbegin()) putchar(c);
    _W(*it, c);
  }
}
void W() {}
template <typename T, typename... K>
void W(const T &head, const K &...tail) {
  _W(head, ' ');
  cout << (sizeof...(tail) ? ' ' : '\n') << flush;
  W(tail...);
}
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230;
template <typename T>
inline T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
inline void amin(T &x, T y) {
  if (x > y) x = y;
}
template <typename T>
inline void amax(T &x, T y) {
  if (x < y) x = y;
}
template <typename A, typename B>
class comp {
 public:
  bool operator()(const pair<A, B> &a, const pair<A, B> &b) {
    if (a.first != b.first)
      return a.first < b.first;
    else
      return a.first > b.first;
  }
};
int n, x, y;
void preprocess(void) { return; }
bool query(vector<int> v) {
  if (v.empty()) {
    return false;
  }
  cout << "? " << (int)v.size();
  for (auto it : (v)) {
    cout << " " << it;
  }
  cout << endl;
  int ans;
  R(ans);
  return (ans == y) || (ans == (x ^ y));
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int teeee;
  teeee = 1;
  for (int zeeee = (1); zeeee <= (teeee); zeeee++) {
    R(n, x, y);
    int m1 = 0, m2 = 0;
    int k = 1000;
    for (int b = (0); b <= ((int)(10) - 1); b++) {
      vector<int> aux;
      for (int i = (1); i <= (n); i++) {
        if (!(i & (1 << b))) {
          aux.push_back(i);
        }
      }
      if (query(aux)) {
        ;
        m1 ^= (1 << b);
        amin(k, b);
      }
    };
    for (int b = (0); b <= ((int)(10) - 1); b++) {
      if (b != k) {
        vector<int> aux;
        for (int i = (1); i <= (n); i++) {
          if (!(i & (1 << k)) && !(i & (1 << b))) {
            aux.push_back(i);
          }
        }
        if (!query(aux)) {
          ;
          m1 ^= (1 << b);
          m2 ^= (1 << b);
        }
      }
    };
    printf("! %d %d\n", min(m1, m2), max(m1, m2));
  }
  cerr << (clock() / (double)CLOCKS_PER_SEC) << endl;
  return 0;
}
