#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y, ans, tmp = 0, pos;
  scanf("%d%d%d", &n, &x, &y);
  vector<int> v;
  for (int i = 1; i <= (1 << 9); i <<= 1) {
    v.clear();
    for (int j = 0; j < n; ++j) {
      if (j & i) v.push_back(j + 1);
    }
    if (v.empty()) continue;
    int len = v.size();
    printf("? %d", len);
    for (int j = 0; j < len; ++j) printf(" %d", v[j]);
    putchar('\n');
    fflush(stdout);
    scanf("%d", &ans);
    if (ans != (len & 1) * x) {
      tmp ^= i;
      pos = i;
    }
  }
  int p1 = 0;
  for (int i = 1; i <= (1 << 9); i <<= 1) {
    if (i == pos) continue;
    v.clear();
    for (int j = 0; j < n; ++j) {
      if ((j & i) && ((j & p1) == p1) && ((j & pos) == 0)) v.push_back(j + 1);
    }
    if (v.empty()) continue;
    int len = v.size();
    printf("? %d", len);
    for (int j = 0; j < len; ++j) printf(" %d", v[j]);
    putchar('\n');
    fflush(stdout);
    scanf("%d", &ans);
    if (ans != (len & 1) * x) p1 |= i;
  }
  int p2 = p1 ^ tmp;
  printf("! %d %d\n", p1 + 1, p2 + 1);
  return 0;
}
