#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int q[1005];
int find() {
  int l = 1, r = *q;
  while (l < r) {
    int mid = (l + r) / 2;
    cout << "? " << mid - l + 1;
    for (int i = (int)(l); i <= (int)(mid); i++) cout << ' ' << q[i];
    cout << endl;
    int v;
    cin >> v;
    if (v != ((mid - l) & 1 ? 0 : x))
      r = mid;
    else
      l = mid + 1;
  }
  return q[l];
}
int main() {
  scanf("%d%d%d", &n, &x, &y);
  int p = 0;
  for (;; ++p) {
    *q = 0;
    for (int i = (int)(1); i <= (int)(n); i++)
      if (i & (1 << p)) q[++*q] = i;
    cout << "?";
    for (int i = (int)(0); i <= (int)(*q); i++) cout << ' ' << q[i];
    cout << endl;
    int v;
    cin >> v;
    if (v != ((*q) & 1 ? x : 0)) break;
  }
  *q = 0;
  for (int i = (int)(1); i <= (int)(n); i++)
    if (i & (1 << p)) q[++*q] = i;
  int ans1 = find();
  *q = 0;
  for (int i = (int)(1); i <= (int)(n); i++) {
    int v1 = i & ((1 << (p + 1)) - 1);
    int v2 = ans1 & ((1 << p) - 1);
    if (v1 == v2) q[++*q] = i;
  }
  int ans2 = find();
  if (ans1 > ans2) swap(ans1, ans2);
  cout << "! " << ans1 << ' ' << ans2;
}
