#include <bits/stdc++.h>
using namespace std;
int n, x, y;
bool vis[5010];
int Query(vector<int> a) {
  if (a.size() == 0) return 0;
  printf("? %d", (int)a.size());
  for (auto &it : a) {
    printf(" %d", it + 1);
  }
  printf("\n");
  fflush(stdout);
  int x;
  scanf("%d", &x);
  return x;
}
int main() {
  int i, j, k = -1, p1 = 0, p2 = 0;
  scanf("%d %d %d", &n, &x, &y);
  for (i = 0; i < 10; ++i) {
    vector<int> a;
    for (j = 0; j < n; ++j)
      if ((j >> i) & 1) a.emplace_back(j);
    if (Query(a) != ((int)a.size() & 1) * x) vis[i] = 1, k = i;
  }
  p1 = 1 << k;
  for (i = 0; i < 10; ++i) {
    if (i == k) continue;
    vector<int> a;
    for (j = 0; j < n; ++j)
      if ((j >> i) & 1 && (j >> k) & 1) a.emplace_back(j);
    if (Query(a) != ((int)a.size() & 1) * x) {
      p1 |= 1 << i;
      if (!vis[i]) p2 |= 1 << i;
    } else if (vis[i])
      p2 |= 1 << i;
  }
  if (p1 > p2) swap(p1, p2);
  printf("! %d %d\n", p1 + 1, p2 + 1);
  return 0;
}
