#include <bits/stdc++.h>
using namespace std;
int n, x, y, result;
int discover(int vals[], int size) {
  int from = 0, to = size;
  while (from + 1 < to) {
    int mid = (from + to) / 2;
    cout << "? " << (mid - from);
    for (int i = from; i < mid; i++) {
      cout << " " << vals[i];
    }
    cout << "\n";
    cin >> result;
    if ((mid - from) % 2 == 1) {
      if (result == x) {
        from = mid;
      } else {
        to = mid;
      }
    } else {
      if (result == 0) {
        from = mid;
      } else {
        to = mid;
      }
    }
    fflush(stdout);
  }
  return vals[from];
}
int main() {
  cin >> n >> x >> y;
  int pom = 0;
  int differ[1001], sizeDiff = 0;
  while ((1 << pom) <= n) {
    int size = 0;
    int mem = (1 << pom);
    for (int i = 1; i <= n; i++) {
      if (i & mem) size++;
    }
    cout << "? " << size;
    for (int i = 1; i <= n; i++) {
      if (i & mem) cout << " " << i;
    }
    cout << "\n";
    cin >> result;
    if (size % 2 == 1) {
      if (result != x) differ[sizeDiff++] = pom;
    } else {
      if (result != 0) differ[sizeDiff++] = pom;
    }
    fflush(stdout);
    pom++;
  }
  int size = 0, vals[1001];
  for (int i = 1; i <= n; i++) {
    if (i & (1 << differ[0])) vals[size++] = i;
  }
  int p1 = discover(vals, size), p2;
  p2 = p1;
  for (int j = 0; j < sizeDiff; j++) {
    p2 ^= (1 << differ[j]);
  }
  if (p1 > p2) swap(p1, p2);
  cout << "! " << p1 << " " << p2 << "\n";
  return 0;
}
