#include <bits/stdc++.h>
using namespace std;
int a[1005], f[10];
int main() {
  int n, x, y;
  scanf("%d%d%d", &n, &x, &y);
  x ^= y;
  int p1 = 0;
  for (int i = 0; i <= 9; i++) {
    a[0] = 0;
    for (int j = 1; j <= n; j++)
      if (j & (1 << i)) a[++a[0]] = j;
    if (!a[0]) break;
    printf("? %d", a[0]);
    for (int j = 1; j <= a[0]; j++) printf(" %d", a[j]);
    printf("\n");
    fflush(stdout);
    int k;
    scanf("%d", &k);
    if (k == y || k == x) f[i] = 1;
    if (p1) continue;
    if (f[i]) {
      int l = 1, r = a[0];
      while (l < r) {
        int mid = (l + r) >> 1;
        printf("? %d", mid - l + 1);
        for (int j = l; j <= mid; j++) printf(" %d", a[j]);
        printf("\n");
        fflush(stdout);
        int kk;
        scanf("%d", &kk);
        if (kk == y || kk == x)
          r = mid;
        else
          l = mid + 1;
      }
      p1 = a[l];
    }
  }
  int p2 = 0;
  for (int i = 0; i <= 9; i++)
    if (f[i]) {
      if ((p1 & (1 << i)) == 0) p2 += 1 << i;
    } else {
      if (p1 & (1 << i)) p2 += 1 << i;
    }
  if (p1 < p2)
    printf("! %d %d\n", p1, p2);
  else
    printf("! %d %d\n", p2, p1);
  return 0;
}
