#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;
const int MAX_A = (1 << 30) - 1;
const int MAX_N = 5e5;

int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int sub = validator.group()[0] - '0';
    int n = inf.readInt(2, MAX_N, "n");
    ensuref(n % 2 == 0, "n must be even");
    inf.readSpace();
    int S = inf.readInt(0, MAX_A, "S");
    inf.readSpace();
    int X = inf.readInt(0, MAX_A, "X");
    inf.readEoln();

    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        a[i] = inf.readInt(0, MAX_A, "a_i");
        if (i == n - 1) {
            inf.readEoln();
        } else {
            inf.readSpace();
        }
    }

    if (sub == 0) {}

    if (sub == 1) {
        ensuref(n <= 20, "Subtask 1: n <= 20 expected");
    }

    if (sub == 2) {
        ensuref(n <= 100, "Subtask 2: n <= 100 expected");
    }

    if (sub == 3) {
        ensuref(S <= 1, "Subtask 3: S <= 1 expected");
        for (int i = 0; i < n; i++)
            ensuref(a[i] >= 1, "Subtask 3: ai >= 1 expected");
    }

    if (sub == 4) {
        ensuref(X == 0, "Subtask 4: X = 0 expected");
    }

    if (sub == 5) {
        ensuref(n <= 2000, "Subtask 5: n <= 2000 expected");
    }

    if (sub == 6) {
        set<long long> st(a.begin(), a.end());
        ensuref((int)st.size() == n, "Subtask 6: all ai must be distinct");
    }

    if (sub == 7) {
        ensuref(n <= 100'000, "Subtask 7: n <= 1e5 expected");
    }

    if (sub == 8) {}

    inf.readEof();
}