#include <bits/stdc++.h>
using namespace std;
vector<int> V, U;
bool vis[1001];
int main() {
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  int siz;
  int tmp;
  bool tag = false;
  int bit = 0;
  int pos;
  int ans = 0;
  for (int i = 0; i <= 9; ++i) {
    V.clear();
    if (!tag) memset(vis, false, sizeof(vis));
    for (int j = 1; j <= n; ++j)
      if (j & (1 << i)) V.push_back(j), vis[j] = true;
    siz = V.size();
    if (!siz) continue;
    printf("? %d ", siz);
    for (int j = 0; j < siz; ++j) printf("%d ", V[j]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &tmp);
    if (tmp == y || tmp == (x ^ y)) {
      bit += 1 << i;
      if (!tag) {
        tag = true;
        pos = i;
        if (siz < n - siz)
          U = V, ans = 1 << i;
        else {
          for (int j = 1; j <= n; ++j)
            if (!vis[j]) U.push_back(j);
        }
      }
    }
  }
  int m = U.size();
  for (int i = 0; i <= 9; ++i) {
    if (pos == i) continue;
    V.clear();
    for (int j = 0; j < m; ++j)
      if (U[j] & (1 << i)) V.push_back(U[j]);
    siz = V.size();
    if (!siz) continue;
    printf("? %d ", siz);
    for (int j = 0; j < siz; ++j) printf("%d ", V[j]);
    printf("\n");
    fflush(stdout);
    scanf("%d", &tmp);
    if (tmp == y || tmp == (x ^ y)) ans += 1 << i;
  }
  printf("! %d %d", min(ans, ans ^ bit), max(ans, ans ^ bit));
}
