#include <bits/stdc++.h>
using std::pair;
using std::vector;
vector<int> Query(size_t range, const vector<pair<size_t, bool>>& bits);
void Print(const vector<int>& query);
int main(int argc, const char* argv[]) {
  size_t count;
  int64_t x, y;
  std::cin >> count >> x >> y;
  vector<bool> disjoint(10);
  for (size_t i = 0; i < 10; ++i) {
    vector<int> query = Query(count, {{i, 1}});
    if (query.size() > 0) {
      Print(query);
      int result;
      std::cin >> result;
      if (query.size() % 2 == 1) {
        result ^= x;
      }
      if (result == 0) {
        disjoint[i] = 0;
      } else {
        disjoint[i] = 1;
      }
    }
  }
  size_t pos;
  for (pos = 0; disjoint[pos] == 0; ++pos) {
    continue;
  }
  vector<bool> a(10), b(10);
  a[pos] = true;
  for (size_t other = 0; other < 10; ++other) {
    if (other != pos) {
      vector<int> query = Query(count, {{pos, 1}, {other, 1}});
      if (query.empty()) {
        continue;
      }
      Print(query);
      int result;
      std::cin >> result;
      if (query.size() % 2 == 1) {
        result ^= x;
      }
      a[other] = (result != 0);
    }
  }
  for (size_t i = 0; i < 10; ++i) {
    b[i] = a[i] ^ disjoint[i];
  }
  int a_num = 0, b_num = 0;
  for (size_t i = 10; i > 0; --i) {
    a_num = 2 * a_num + a[i - 1];
    b_num = 2 * b_num + b[i - 1];
  }
  if (a_num > b_num) {
    std::swap(a_num, b_num);
  }
  std::cout << "! " << a_num << " " << b_num << std::endl;
  return 0;
}
void Print(const vector<int>& query) {
  std::cout << "? " << query.size();
  for (auto num : query) {
    std::cout << ' ' << num;
  }
  std::cout << std::endl;
}
vector<int> Query(size_t range, const vector<pair<size_t, bool>>& bits) {
  vector<int> answers;
  for (size_t i = 1; i <= range; ++i) {
    bool flag = true;
    for (auto constain : bits) {
      if (((i & (1 << constain.first)) != 0) ^ constain.second) {
        flag = false;
        break;
      }
    }
    if (flag) {
      answers.push_back(i);
    }
  }
  return answers;
}
