#include <bits/stdc++.h>
using namespace std;
int pos;
vector<int> V, V1, V2;
bool same[10];
int N, X, Y, ans, ans1, ans2;
void f(vector<int> V) {
  int lo = 1, hi = V.size();
  while (lo < hi) {
    int med = (lo + hi) / 2;
    printf("? %d", med);
    for (int i = 0; i < (int)med; i++) printf(" %d", V[i]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &ans);
    if (ans == 0 || ans == X)
      lo = med + 1;
    else
      hi = med;
  }
  ans1 = V[lo - 1];
}
int main() {
  scanf("%d", &N), scanf("%d", &X), scanf("%d", &Y);
  for (int i = 0; i < (int)10; i++) {
    V.clear();
    for (int n = 1; n < (int)N + 1; n++)
      if (n & (1 << i)) V.push_back(n);
    if (V.empty()) {
      same[i] = true;
      continue;
    }
    printf("? %d", (int)V.size());
    for (int i = 0; i < (int)V.size(); i++) printf(" %d", V[i]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &ans);
    if (ans == 0 || ans == X)
      same[i] = true;
    else
      pos = i;
  }
  for (int n = 1; n < (int)N + 1; n++)
    if ((n & (1 << pos)) != 0) V1.push_back(n);
  for (int n = 1; n < (int)N + 1; n++)
    if ((n & (1 << pos)) == 0) V2.push_back(n);
  if (V1.size() <= V2.size())
    f(V1);
  else
    f(V2);
  for (int i = 0; i < (int)10; i++) {
    if ((ans1 & (1 << i)) != 0 && same[i]) ans2 |= 1 << i;
    if ((ans1 & (1 << i)) == 0 && !same[i]) ans2 |= 1 << i;
  }
  if (ans1 > ans2) swap(ans1, ans2);
  printf("! %d %d\n", ans1, ans2);
  fflush(stdout);
}
