#include <bits/stdc++.h>
using namespace std;
const int INF = 2147483647;
const int mod = 1e9 + 7;
const double pi = acos(-1.0);
const int maxn = 100011;
int a[12];
int flag[12];
int main() {
  int n, sx, sy;
  cin >> n >> sx >> sy;
  for (int i = 0; i < 10; i++) {
    vector<int> v;
    for (int j = 1; j <= n; j++)
      if ((j >> i) & 1) v.push_back(j);
    if (v.size() == 0) {
      flag[i] = 1;
      continue;
    }
    cout << "?";
    cout << " " << v.size();
    for (int j = 0; j < v.size(); j++) cout << " " << v[j];
    cout << endl;
    fflush(stdout);
    int ans;
    cin >> ans;
    if (ans == 0 || ans == sx) flag[i] = 1;
  }
  int root;
  for (int i = 0; i < 10; i++) {
    if (flag[i] == 0) {
      flag[i] = 2;
      a[i] = 1;
      root = i;
      break;
    }
  }
  for (int i = 0; i < 10; i++) {
    if (flag[i] == 2) continue;
    vector<int> v;
    for (int j = 1; j <= n; j++)
      if (((j >> i) & 1) && ((j >> root) & 1)) v.push_back(j);
    if (v.size() == 0) {
      a[i] = 0;
      continue;
    }
    cout << "?";
    cout << " " << v.size();
    for (int j = 0; j < v.size(); j++) cout << " " << v[j];
    cout << endl;
    fflush(stdout);
    int ans;
    cin >> ans;
    if (ans == 0 || ans == sx)
      a[i] = 0;
    else
      a[i] = 1;
  }
  int a1 = 0, a2 = 0;
  for (int i = 9; i >= 0; i--) {
    a1 <<= 1;
    a1 += a[i];
    a2 <<= 1;
    a2 += (flag[i] == 1) ? a[i] : (a[i] ^ 1);
  }
  if (a1 > a2) swap(a1, a2);
  cout << "! " << a1 << " " << a2 << endl;
  fflush(stdout);
  return 0;
}
