#include <bits/stdc++.h>
using namespace std;
const double g = 10.0, eps = 1e-12;
const int N = 500 + 10, maxn = 1200000 + 10, inf = 0x3f3f3f3f,
          INF = 0x3f3f3f3f3f3f3f3f;
const long long ba = 163;
int d[N];
int main() {
  long long n, x, y;
  scanf("%lld%lld%lld", &n, &x, &y);
  memset(d, -1, sizeof d);
  int id;
  for (int i = 0; i < 10; i++) {
    vector<int> te;
    for (int j = 1; j <= n; j++)
      if ((j >> i) & 1) te.push_back(j);
    if (te.size() == 0) continue;
    printf("? %d", te.size());
    for (int j = 0; j < te.size(); j++) printf(" %d", te[j]);
    puts("");
    fflush(stdout);
    long long p;
    scanf("%lld", &p);
    if (p == 0 || p == x)
      d[i] = 1;
    else
      d[i] = 0, id = i;
  }
  vector<int> v1, v2;
  for (int j = 1; j <= n; j++) {
    if ((j >> id) & 1)
      v1.push_back(j);
    else
      v2.push_back(j);
  }
  if (v1.size() > v2.size()) swap(v1, v2);
  int ans1 = 0;
  for (int i = 0; i < 9; i++) {
    vector<int> te;
    for (int j = 0; j < v1.size(); j++)
      if ((j >> i) & 1) te.push_back(v1[j]);
    if (te.size() == 0) continue;
    printf("? %d", te.size());
    for (int j = 0; j < te.size(); j++) printf(" %d", te[j]);
    puts("");
    fflush(stdout);
    long long p;
    scanf("%lld", &p);
    if (p != 0 && p != x) ans1 ^= (1 << i);
  }
  ans1 = v1[ans1];
  int ans2 = ans1;
  for (int i = 0; i < 10; i++)
    if (d[i] == 0) ans2 ^= (1 << i);
  if (ans1 > ans2) swap(ans1, ans2);
  printf("! %d %d\n", ans1, ans2);
  return 0;
  ;
}
