This is an interactive problem.

As he qualified for IOI this year, Little Ericyi was given a gift from all his friends: a tree of $n$ nodes!

On the flight to IOI Little Ericyi was very bored, so he decided to play a game with Little Yvonne with his new tree. First, Little Yvonne selects two (not necessarily different) nodes $a$ and $b$ on the tree (without telling Ericyi), and then gives him a hint $f$ (which is some node on the path from $a$ to $b$).

Then, Little Ericyi is able to ask the following question repeatedly:

* If I rooted the tree at node $r$ (Ericyi gets to choose $r$), what would be the Lowest Common Ancestor of $a$ and $b$?

Little Ericyi's goal is to find the nodes $a$ and $b$, and report them to Little Yvonne.

However, Little Yvonne thought this game was too easy, so before he gives the hint $f$ to Little Ericyi, he also wants him to first find the maximum number of queries required to determine $a$ and $b$ over all possibilities of $a$, $b$, and $f$ assuming Little Ericyi plays optimally. Little Ericyi defines an optimal strategy as one that makes the minimum number of queries. Of course, once Little Ericyi replies with the maximum number of queries, Little Yvonne will only let him use that many queries in the game.

The tree, $a$, $b$, and $f$ are all fixed before the start of the game and do not change as queries are made.

Interaction

First read a line containing the integer $n$ ($1 \le n \le 10^5$), the number of nodes in the tree.

The next $n−1$ lines describe Little Ericyi's tree. These lines contain two integers $u$ and $v$ ($1 \le u,v \le n$) denoting an edge between $u$ and $v$ ($u \neq v$). It is guaranteed that these edges form a tree.

After that you should output $k$, the maximum number of queries needed to determine $a$ and $b$ over all possibilities of $a$, $b$, and $f$ assuming Little Ericyi plays optimally. You should output end of line and flush the output after printing $k$.

After that read a line containing the integer $f$ ($1 \le f \le n$) — the hint: a node on the path from $a$ to $b$, inclusive.

After that, you can start making queries. You will be limited to making at most $k$ queries, where $k$ is the number you printed.

Each query is made in the format "? r", where $r$ is an integer $1 \le r \le n$ denoting the root node you want for the query.

You will then receive an integer $x$ ($1 \le x \le n$), the Lowest Common Ancestor of $a$ and $b$ if the tree was rooted at $r$.

When your program has found the nodes $a$, $b$, report the answer in the following format: "! a b", where $a$ and $b$ are the two hidden nodes and terminate your program normally immediately after flushing the output stream. You may output $a$ and $b$ in any order.

After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:

* fflush(stdout) or cout.flush() in C++;
* System.out.flush() in Java;
* flush(output) in Pascal;
* stdout.flush() in Python;
* see documentation for other languages.

If at any point you make an invalid output or make more than $k$ queries, the interaction will terminate and you will receive a Wrong Answer verdict. An invalid output is defined as either an invalid query or a value of $k$ less than $0$ or greater than $n$.

Examples

Input

```
4
3 2
2 1
2 4

1

1

2

2
```

Output

```
3? 1? 2? 3! 4 1
```

Input

```
5
3 1
1 4
4 5
4 2

1

4

1

4
```

Output

```
3? 4? 1? 5! 1 4
```

Note

Here is the the tree from the first sample interaction. Nodes $a$ and $b$ are highlighted.![](https://espresso.codeforces.com/e9bafefcbcf2b756b5e46472466e179f5406956c.png)

Notice that $a$ and $b$ can be output in any order.

Additionally, here are the answers to querying every single node $1,2,\ldots,n$ for your convenience:

* $1$: $1$
* $2$: $2$
* $3$: $2$
* $4$: $4$

\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Here is the the tree from the second sample interaction. Again, nodes $a$ and $b$ are highlighted.![](https://espresso.codeforces.com/bf6083420f0d88ebe3accc47e3008e805be9cc71.png)

Lastly, here are the answers to querying every single node $1,2,\ldots,n$ (in example $2$) for your convenience:

* $1$: $1$
* $2$: $4$
* $3$: $1$
* $4$: $4$
* $5$: $4$

#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

static long long queries = 0;
static long long query_limit = 0;
static const long long HARD_CAP = 300000;

void log_metrics() {
    try {

        tout << "queries=" << queries << endl;
        tout << "query_limit=" << query_limit << endl;
    } catch (...) {

    }
}

void finish(TResult verdict, const string& msg) {
    log_metrics();
    quitf(verdict, "%s", msg.c_str());
}

const int MAXN = 100005;
const int LOGN = 20;

int n;
vector<int> adj[MAXN];
int up[MAXN][LOGN];
int depth[MAXN];

void dfs(int u, int p, int d) {
    depth[u] = d;
    up[u][0] = p;
    for (int i = 1; i < LOGN; i++) {
        up[u][i] = up[up[u][i-1]][i-1];
    }
    for (int v : adj[u]) {
        if (v != p) dfs(v, u, d + 1);
    }
}

int get_lca(int u, int v) {
    if (depth[u] < depth[v]) swap(u, v);
    for (int i = LOGN - 1; i >= 0; i--) {
        if (depth[u] - (1 << i) >= depth[v]) {
            u = up[u][i];
        }
    }
    if (u == v) return u;
    for (int i = LOGN - 1; i >= 0; i--) {
        if (up[u][i] != up[v][i]) {
            u = up[u][i];
            v = up[v][i];
        }
    }
    return up[u][0];
}

int get_median(int a, int b, int r) {
    int x = get_lca(a, b);
    int y = get_lca(b, r);
    int z = get_lca(r, a);

    int res = x;
    if (depth[y] > depth[res]) res = y;
    if (depth[z] > depth[res]) res = z;
    return res;
}

int main(int argc, char** argv) {

    registerInteraction(argc, argv);
    atexit(log_metrics);

    n = inf.readInt(1, 100000, "n");
    vector<pair<int, int>> edges;
    for (int i = 0; i < n - 1; i++) {
        int u = inf.readInt(1, n, "u");
        int v = inf.readInt(1, n, "v");
        edges.push_back({u, v});
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    int a_hidden = inf.readInt(1, n, "a");
    int b_hidden = inf.readInt(1, n, "b");
    int f_hidden = inf.readInt(1, n, "f");

    dfs(1, 1, 0);

    cout << n << endl;
    for (auto& e : edges) {
        cout << e.first << " " << e.second << endl;
    }
    cout.flush();

    string token;
    if (!(cin >> token)) {
        finish(_pe, "Expected k (max queries), found EOF");
    }

    try {
        size_t idx;
        long long k_val = stoll(token, &idx);
        if (idx != token.size()) finish(_pe, "Invalid format for k");
        if (k_val < 0 || k_val > n) finish(_wa, "k must be between 0 and n");
        query_limit = k_val;
    } catch (...) {
        finish(_pe, "Invalid format for k");
    }

    log_metrics();

    cout << f_hidden << endl;

    while (true) {
        if (!(cin >> token)) {
            finish(_pe, "Unexpected EOF during query phase");
        }

        if (token == "!") {

            int ua, ub;
            if (!(cin >> ua >> ub)) {
                finish(_pe, "Expected two integers after '!'");
            }

            bool correct = (ua == a_hidden && ub == b_hidden) || (ua == b_hidden && ub == a_hidden);

            if (correct) {
                finish(_ok, "Found correct nodes");
            } else {
                finish(_wa, format("Expected {%d, %d}, found {%d, %d}", a_hidden, b_hidden, ua, ub));
            }
        } else if (token == "?") {

            int r;
            if (!(cin >> r)) {
                finish(_pe, "Expected integer r after '?'");
            }

            queries++;

            if (queries % 10 == 0) log_metrics();

            if (queries > HARD_CAP) {
                finish(_pe, "Hard query limit exceeded (potential infinite loop)");
            }

            if (r < 1 || r > n) {
                finish(_wa, "Query root r out of bounds");
            }

            int ans = get_median(a_hidden, b_hidden, r);
            cout << ans << endl;
        } else {

            finish(_pe, "Expected '?' or '!', found: " + token);
        }
    }

    return 0;
}

#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;

static int n;
static vector<vector<int>> adj;
static vector<int> depth;
static vector<vector<int>> up;
static int LOG;
static long long queries = 0;
static long long query_limit = 0;

void log_metrics() {
    try {
        tout << "queries=" << queries << endl;
        tout << "query_limit=" << query_limit << endl;
    } catch (...) {

    }
}

void finish(TResult verdict, const string& msg) {
    log_metrics();
    quitf(verdict, "%s", msg.c_str());
}

void dfs(int u, int p, int d) {
    depth[u] = d;
    up[u][0] = p;
    for (int i = 1; i <= LOG; ++i) {
        up[u][i] = up[up[u][i - 1]][i - 1];
    }
    for (int v : adj[u]) {
        if (v != p) dfs(v, u, d + 1);
    }
}

int get_lca(int u, int v) {
    if (depth[u] < depth[v]) swap(u, v);
    for (int i = LOG; i >= 0; --i) {
        if (depth[u] - (1 << i) >= depth[v]) {
            u = up[u][i];
        }
    }
    if (u == v) return u;
    for (int i = LOG; i >= 0; --i) {
        if (up[u][i] != up[v][i]) {
            u = up[u][i];
            v = up[v][i];
        }
    }
    return up[u][0];
}

int get_median(int u, int v, int w) {
    int x = get_lca(u, v);
    int y = get_lca(v, w);
    int z = get_lca(u, w);
    int res = x;
    if (depth[y] > depth[res]) res = y;
    if (depth[z] > depth[res]) res = z;
    return res;
}

bool findPath(int u, int target, int p, vector<int>& path) {
    path.push_back(u);
    if (u == target) return true;
    for (int v : adj[u]) {
        if (v != p) {
            if (findPath(v, target, u, path)) return true;
        }
    }
    path.pop_back();
    return false;
}

int main(int argc, char** argv) {
    registerInteraction(argc, argv);
    atexit(log_metrics);

    n = inf.readInt(1, 100000, "n");

    adj.resize(n + 1);
    vector<pair<int, int>> edge_list;
    for (int i = 0; i < n - 1; ++i) {
        int u = inf.readInt(1, n, "u");
        int v = inf.readInt(1, n, "v");
        ensuref(u != v, "Self loop edge %d-%d", u, v);
        adj[u].push_back(v);
        adj[v].push_back(u);
        edge_list.push_back({u, v});
    }

    LOG = 0;
    while ((1 << LOG) <= n) LOG++;
    depth.assign(n + 1, 0);
    up.assign(n + 1, vector<int>(LOG + 1));
    if (n > 0) dfs(1, 1, 0);

    cout << n << endl;
    for (auto& e : edge_list) {
        cout << e.first << " " << e.second << endl;
    }
    cout.flush();

    long long k_usr;
    if (!(cin >> k_usr)) {
        finish(_wa, "Failed to read K from contestant");
    }
    if (k_usr < 0 || k_usr > n) {
        finish(_wa, format("Invalid K: %lld", k_usr));
    }
    query_limit = k_usr;

    int a, b, f_hint;
    inf.skipBlanks();
    if (!inf.eof()) {

        a = inf.readInt(1, n, "a");
        b = inf.readInt(1, n, "b");
        f_hint = inf.readInt(1, n, "f");
    } else {

        a = rnd.next(1, n);
        b = rnd.next(1, n);
        vector<int> path;
        findPath(a, b, 0, path);
        if (path.empty()) finish(_fail, "Path finding failed");
        f_hint = path[rnd.next(0, (int)path.size() - 1)];
    }

    cout << f_hint << endl;
    cout.flush();

    log_metrics();

    long long hard_cap = 200000;
    if (query_limit > 0) hard_cap = max(hard_cap, query_limit * 10);

    while (true) {
        string type;
        if (!(cin >> type)) {
            finish(_wa, "Unexpected EOF awaiting query/answer");
        }

        if (type == "!") {
            int ans_a, ans_b;
            if (!(cin >> ans_a >> ans_b)) {
                finish(_wa, "Invalid answer format");
            }

            bool correct = (ans_a == a && ans_b == b) || (ans_a == b && ans_b == a);
            if (correct) {
                finish(_ok, format("Found {%d, %d} in %lld queries", a, b, queries));
            } else {
                finish(_wa, format("Wrong answer: expected {%d, %d}, found {%d, %d}", a, b, ans_a, ans_b));
            }
        } else if (type == "?") {
            int r;
            if (!(cin >> r)) {
                finish(_wa, "Invalid query format");
            }
            if (r < 1 || r > n) {
                finish(_wa, format("Query root %d out of bounds", r));
            }

            queries++;

            if (queries % 2000 == 0) log_metrics();

            if (queries > hard_cap) {
                finish(_pe, "Too many queries (hard cap exceeded)");
            }

            int ans = get_median(a, b, r);
            cout << ans << endl;
            cout.flush();
        } else {
            finish(_wa, format("Unknown token '%s'", type.c_str()));
        }
    }

    return 0;
}

#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[]) {
    registerGen(argc, argv, 1);

    string mode = opt<string>("mode", "non");

    long long seed_val = 0;
    if (argc > 1) seed_val = atoll(argv[1]);

    int n;
    int type;

    if (seed_val == 1) {
        n = 4; type = 0;
    } else if (seed_val == 2) {
        n = 5; type = 0;
    } else if (seed_val == 3) {
        n = 100000; type = 1;
    } else if (seed_val == 4) {
        n = 100000; type = 2;
    } else {

        if (rnd.next(3) > 0) n = rnd.next(90000, 100000);
        else n = rnd.next(10, 100000);

        type = rnd.next(0, 4);
    }

    if (n < 1) n = 1;

    vector<pair<int, int>> edges;
    if (n > 1) {
        if (type == 0) {
            for (int i = 1; i < n; i++) {
                edges.push_back({i, rnd.next(0, i - 1)});
            }
        } else if (type == 1) {
            for (int i = 1; i < n; i++) {
                edges.push_back({i, i - 1});
            }
        } else if (type == 2) {
            for (int i = 1; i < n; i++) {
                edges.push_back({i, 0});
            }
        } else if (type == 3) {
            int len = rnd.next(1, n);

            for (int i = 1; i < len; i++) {
                edges.push_back({i, i - 1});
            }

            for (int i = len; i < n; i++) {
                edges.push_back({i, rnd.next(0, len - 1)});
            }
        } else if (type == 4) {
            for (int i = 1; i < n; i++) {

                edges.push_back({i, rnd.wnext(i, 20)});
            }
        }
    }

    vector<int> p = rnd.perm(n);
    vector<pair<int, int>> final_edges;
    for (auto e : edges) {
        final_edges.push_back({p[e.first] + 1, p[e.second] + 1});
    }

    shuffle(final_edges.begin(), final_edges.end());

    cout << n << endl;
    for (auto e : final_edges) {
        cout << e.first << " " << e.second << endl;
    }

    if (mode == "non") {
        if (n == 1) {

            cout << "1 1 1" << endl;
        } else {

            vector<vector<int>> adj(n + 1);
            for (auto e : final_edges) {
                adj[e.first].push_back(e.second);
                adj[e.second].push_back(e.first);
            }

            int a, b;

            if (rnd.next(2) == 0) {
                a = rnd.next(1, n);
                b = rnd.next(1, n);
            } else {

                auto bfs_far = [&](int start) {
                    queue<int> q; q.push(start);
                    vector<int> dist(n + 1, -1); dist[start] = 0;
                    int far = start;
                    while (!q.empty()) {
                        int u = q.front(); q.pop();
                        if (dist[u] > dist[far]) far = u;
                        for (int v : adj[u]) {
                            if (dist[v] == -1) {
                                dist[v] = dist[u] + 1;
                                q.push(v);
                            }
                        }
                    }
                    return far;
                };

                int u = bfs_far(rnd.next(1, n));
                int v = bfs_far(u);

                a = u;

                int decision = rnd.next(3);
                if (decision == 0) b = v;
                else if (decision == 1) b = rnd.next(1, n);
                else b = u;
            }

            queue<int> q; q.push(a);
            vector<int> parent(n + 1, 0);
            vector<bool> vis(n + 1, false);
            vis[a] = true;

            bool found = false;
            while (!q.empty()) {
                int u = q.front(); q.pop();
                if (u == b) { found = true; break; }
                for (int v : adj[u]) {
                    if (!vis[v]) {
                        vis[v] = true;
                        parent[v] = u;
                        q.push(v);
                    }
                }
            }

            vector<int> path;
            int curr = b;
            while (true) {
                path.push_back(curr);
                if (curr == a) break;
                curr = parent[curr];
            }

            int f = path[rnd.next(path.size())];

            cout << a << " " << b << " " << f << endl;
        }
    }

    return 0;
}


This is an interactive problem.

In the Wonderful Metropolis of the Future, there is no need in subway train drivers. Due to the technological progress, they were replaced by the Artificial Intelligence (AI). Unfortunately, one day the predictions of sci-fi writers came true: the AI rebelled and now there is an uncontrollable train in the subway. It can be dangerous! Your task is to find the train and stop the AI.

The subway of the Metropolis is one line (regular straight line with no self-intersections) with $n$ stations, indexed consecutively from $1$ to $n$. At each moment the train is at some station. You need to determine the index of this station, so that the train would be secured.

To find the train, dispatcher Sarah gave you a gadget that allows you to select arbitrary numbers $l$ and $r$ ($l \le r$), and then check, whether the train is located on a station with index between $l$ and $r$, inclusive. Unfortunately, recharging of the gadget takes some time (and every time you use it as soon as possible), so between two applications of the gadget the train can move to any station that is at most $k$ stations away. Formally, if the train was at the station $x$ when the gadget was applied, then at the next application of the gadget the train can appear at any station $y$ such that $\max(1, x - k) \leq y \leq \min(n, x + k)$.

Note that AI is not aware that you are trying to catch the train, so it makes all moves according to its predefined plan.

After an examination of the gadget you found that it is very old and can hold no more than $4500$ applications, after which it will break and your mission will be considered a failure.

Can you find the station with the train using no more than $4500$ applications of the gadgets?

Input

The first line contains two integers $n$ and $k$ ($1 \leq n \leq 10^{18}$, $0 \leq k \leq 10$) — the number of stations and the maximum number of stations the train can move between two applications of the gadget.

Interaction

You can apply the gadget at most $4500$ times. In order to apply the gadget you need to print two space-separated integers $l$ and $r$ ($1 \leq l \leq r \leq n$). You will then receive either string "Yes", if the train is between stations $l$ and $r$, inclusive, or string "No" otherwise. If $l = r$ and you received "Yes", then you found the train successfully, and your program must halt immediately.

Answer "Bad" instead of "Yes" or "No" means that you made an invalid query or made too many queries. Exit immediately after receiving "Bad" and you will see Wrong answer verdict. Otherwise you can get an arbitrary verdict because your solution will continue to read from a closed stream.

After printing a query do not forget to output end of line and flush the output. Otherwise you will get Idleness limit exceeded. To do this, use:

* fflush(stdout) or cout.flush() in C++;
* System.out.flush() in Java;
* flush(output) in Pascal;
* stdout.flush() in Python;
* see documentation for other languages.

Example

Input

```
10 2

Yes

No

Yes

Yes
```

Output

```
3 5

3 3

3 4

5 5
```

Note

In the first sample, the train was initially at the station $5$, after the first application of the gadget it did not move, after the second application it moved to the station $3$, and after the third application moved again to the station $5$.

#include "testlib.h"

#include <csignal>
#include <cstdint>
#include <iostream>
#include <string>

using namespace std;

static int queries = 0;
static int query_limit = 4500;

static void log_queries() {
    tout << "queries=" << queries << "\n";
    tout << "query_limit=" << query_limit << "\n";
}

[[noreturn]] static void quit_with(TResult verdict, const string& msg) {
    log_queries();
    quitf(verdict, "%s", msg.c_str());
}

static uint64_t splitmix64(uint64_t x) {

    x += 0x9e3779b97f4a7c15ULL;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ULL;
    x = (x ^ (x >> 27)) * 0x94d049bb133111ebULL;
    return x ^ (x >> 31);
}

int main(int argc, char* argv[]) {
    registerInteraction(argc, argv);
    signal(SIGPIPE, SIG_IGN);
    atexit(log_queries);

    const long long n = inf.readLong();
    const long long k = inf.readLong();
    long long pos = inf.readLong();
    uint64_t plan_seed = 1;
    if (!inf.seekEof()) plan_seed = (uint64_t)inf.readLong();
    if (pos < 1 || pos > n) {
        quit_with(_fail, "Invalid hidden position");
    }

    cout << n << " " << k << "\n" << flush;

    while (true) {
        long long l = 0, r = 0;
        if (!(cin >> l >> r)) quit_with(_wa, "Unexpected EOF");

        queries++;
        if (queries > query_limit) {
            cout << "Bad\n" << flush;
            quit_with(_wa, "Too many queries");
        }
        if (!(1 <= l && l <= r && r <= n)) {
            cout << "Bad\n" << flush;
            quit_with(_wa, "Query out of range");
        }

        const bool yes = (l <= pos && pos <= r);
        cout << (yes ? "Yes" : "No") << "\n" << flush;

        if (yes && l == r) {
            quit_with(_ok, "Found");
        }

        if (k > 0 && n > 1) {
            const uint64_t x = splitmix64(plan_seed + (uint64_t)queries);
            const long long dir = (x & 1ULL) ? 1LL : -1LL;
            long long next_pos = pos + dir * k;
            if (next_pos < 1) next_pos = 1;
            if (next_pos > n) next_pos = n;
            pos = next_pos;
        }
    }
}

#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char* argv[]) {
    registerGen(argc, argv, 1);

    const long long seed = (argc >= 2) ? atoll(argv[1]) : 1;

    long long n = (long long)1e18;
    long long k = 10;
    long long pos = 1;

    if (seed == 1) {
        n = (long long)1e18;
        k = 10;
        pos = 1;
    } else if (seed == 2) {
        n = (long long)1e18;
        k = 10;
        pos = n;
    } else if (seed == 3) {
        n = (long long)1e18;
        k = 10;
        pos = n / 2;
    } else if (seed == 4) {
        n = (long long)1e18 - 7;
        k = 10;
        pos = n / 2;
    } else if (seed <= 10) {

        n = rnd.next(1LL, (long long)1000000);
        k = 10;
        pos = rnd.next(1LL, n);
    } else {

        long long lo = (long long)9e17;
        long long hi = (long long)1e18;
        n = rnd.next(lo, hi);
        k = 10;
        pos = rnd.next(1LL, n);
    }

    const long long plan_seed = rnd.next(1LL, (1LL << 62) - 1);

    cout << n << " " << k << "\n";
    cout << pos << " " << plan_seed << "\n";
    return 0;
}


This is an interactive problem.

Anton and Harris are playing a game to decide which of them is the king of problemsetting.

There are three piles of stones, initially containing $a$, $b$, and $c$ stones, where $a$, $b$, and $c$ are distinct positive integers. On each turn of the game, the following sequence of events takes place:

* The first player chooses a positive integer $y$ and provides it to the second player.
* The second player adds $y$ stones to one of the piles, with the condition that he cannot choose the same pile in two consecutive turns.

The second player loses if, at any point, two of the piles contain the same number of stones. The first player loses if $1000$ turns have passed without the second player losing.

Feeling confident in his skills, Anton decided to let Harris choose whether he wants to go first or second. Help Harris defeat Anton and become the king of problemsetting!

Input

The first line of input contains three distinct positive integers $a$, $b$, and $c$ ($1 \le a, b, c \le 10^9$)  — the initial number of stones in piles $1$, $2$, and $3$ respectively.

Interaction

The interaction begins by reading the integers $a$, $b$ and $c$.

After reading the integers, print a single line containing either "First" or "Second", denoting who you want to play as (as first or second correspondently).

On each turn, the first player (either you or the judge) must print a positive integer $y$ ($1 \le y \le 10^{12}$).

Then, the second player must print $1$, $2$, or $3$, indicating which pile should have $y$ stones added to it. From the second turn onwards, the pile that the second player chooses must be different from the pile that they chose on the previous turn.

If you are playing as Second and complete $1000$ turns without losing, or if you are playing as First and the judge has determined that it cannot make a move without losing, the interactor will print $0$ and will finish interaction. This means that your program is correct for this test case, and you should exit immediately.

If you are playing as First and complete $1000$ turns without winning, or if you are playing as Second and print a move that makes two piles have the same number of stones, or if you output an invalid move as either player, the interactor will print $-1$ and will finish interaction. You will receive a Wrong Answer verdict. Make sure to exit immediately to avoid getting other verdicts.

After printing something do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:

* fflush(stdout) or cout.flush() in C++;
* System.out.flush() in Java;
* flush(output) in Pascal;
* stdout.flush() in Python;
* see documentation for other languages.

Example

Input

```
5 2 6

3

0
```

Output

```
First
2

3
```

Note

In the sample input, the piles initially have $5$, $2$, and $6$ stones. Harris decides to go first and provides the number $2$ to Anton. Anton adds $2$ stones to the third pile, which results in $5$, $2$, and $8$.

In the next turn, Harris chooses $3$. Note that Anton cannot add the stones to the third pile since he chose the third pile in the previous turn. Anton realizes that he has no valid moves left and reluctantly recognizes Harris as the king.

#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

static long long queries = 0;
static long long query_limit = 1000;

static void log_metrics() {
    try {

        tout << "queries=" << queries << endl;
        tout << "query_limit=" << query_limit << endl;
    } catch (...) {}
}

static void finish(TResult verdict, const string& msg) {
    log_metrics();
    quitf(verdict, "%s", msg.c_str());
}

int main(int argc, char** argv) {
    registerInteraction(argc, argv);
    atexit(log_metrics);

    long long a = inf.readInt();
    long long b = inf.readInt();
    long long c = inf.readInt();

    cout << a << " " << b << " " << c << endl;

    string role;
    if (!(cin >> role)) {
        finish(_pe, "Unexpected EOF reading role");
    }

    vector<long long> p = {0, a, b, c};
    int last_pile = 0;

    if (role == "First") {

        while (queries < query_limit) {
            queries++;
            long long y;
            if (!(cin >> y)) {
                finish(_pe, "Unexpected EOF or invalid format reading y");
            }

            if (y < 1 || y > 1000000000000LL) {
                 cout << -1 << endl;
                 finish(_wa, "y out of range");
            }

            vector<int> candidates;
            for (int i = 1; i <= 3; i++) {
                if (i != last_pile) candidates.push_back(i);
            }

            vector<int> safe_moves;
            for (int idx : candidates) {
                long long new_val = p[idx] + y;
                bool eq = false;
                for (int other = 1; other <= 3; other++) {
                    if (idx != other && p[other] == new_val) eq = true;
                }
                if (!eq) safe_moves.push_back(idx);
            }

            if (safe_moves.empty()) {

                cout << 0 << endl;
                finish(_ok, "Contestant forced equality");
            } else {

                int move = safe_moves[0];
                p[move] += y;
                last_pile = move;
                cout << move << endl;
            }
        }

        cout << -1 << endl;
        finish(_wa, "Query limit exceeded without forcing equality");

    } else if (role == "Second") {

        while (queries < query_limit) {
            queries++;
            long long y_out = 0;

            if (queries == 1) {
                y_out = 1000000000LL;
            } else {
                vector<long long> vals;
                for(int i=1; i<=3; ++i) vals.push_back(p[i]);
                sort(vals.begin(), vals.end());
                long long x = vals[0];
                long long yy = vals[1];
                long long z = vals[2];

                if (queries == 2) {
                    y_out = 2 * z - x - yy;
                } else if (queries == 3) {
                    y_out = z - yy;
                } else {
                    y_out = 1;
                }
            }

            cout << y_out << endl;

            int k;
            if (!(cin >> k)) {
                finish(_pe, "Unexpected EOF reading pile index");
            }

            if (k < 1 || k > 3) {
                cout << -1 << endl;
                finish(_wa, "Invalid pile index (range)");
            }
            if (k == last_pile) {
                cout << -1 << endl;
                finish(_wa, "Invalid pile index (same as previous)");
            }

            p[k] += y_out;
            last_pile = k;

            if (p[1] == p[2] || p[1] == p[3] || p[2] == p[3]) {
                cout << -1 << endl;
                finish(_wa, "Contestant move created equality");
            }
        }

        cout << 0 << endl;
        finish(_ok, "Contestant survived 1000 turns");

    } else {
        finish(_pe, "Invalid role (expected First or Second)");
    }

    return 0;
}

#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;

static int queries = 0;
static const int query_limit = 1000;
static long long p[4];
static int last_idx = 0;

void log_metrics() {
    try {
        tout << "queries=" << queries << endl;
        tout << "query_limit=" << query_limit << endl;
    } catch (...) {}
}

void finish(TResult verdict, const string& msg, int exit_code_to_contestant = -2) {
    if (exit_code_to_contestant == 0) {
        cout << 0 << endl;
    } else if (exit_code_to_contestant == -1) {
        cout << -1 << endl;
    }
    log_metrics();
    quitf(verdict, "%s", msg.c_str());
}

bool check_collision() {
    return (p[1] == p[2] || p[1] == p[3] || p[2] == p[3]);
}

long long get_win_move() {

    vector<pair<long long, int>> v;
    for(int i=1; i<=3; ++i) v.push_back({p[i], i});
    sort(v.begin(), v.end());

    long long a = v[0].first;
    long long b = v[1].first;
    long long c = v[2].first;
    int max_idx = v[2].second;

    bool is_ap = (b - a == c - b);

    if (is_ap && last_idx == max_idx) {
        return b - a;
    } else {

        return 2 * c - b - a;
    }
}

int main(int argc, char** argv) {
    registerInteraction(argc, argv);
    atexit(log_metrics);

    p[1] = inf.readLong();
    p[2] = inf.readLong();
    p[3] = inf.readLong();

    cout << p[1] << " " << p[2] << " " << p[3] << endl;

    log_metrics();

    string role;
    if (!(cin >> role)) finish(_wa, "Unexpected EOF reading role", -1);

    bool human_is_first;
    if (role == "First") human_is_first = true;
    else if (role == "Second") human_is_first = false;
    else finish(_wa, "Invalid role: " + role, -1);

    for (queries = 1; queries <= query_limit; queries++) {
        log_metrics();

        if (human_is_first) {

            long long y;
            if (!(cin >> y)) finish(_wa, "Unexpected EOF reading y", -1);
            if (y < 1 || y > 1000000000000LL) finish(_wa, "y out of range", -1);

            int move = -1;

            for (int i = 1; i <= 3; i++) {
                if (i == last_idx) continue;

                p[i] += y;
                if (!check_collision()) {
                    move = i;
                    break;
                }
                p[i] -= y;
            }

            if (move != -1) {
                last_idx = move;
                cout << move << endl;
            } else {

                finish(_ok, "Interactor forced to lose (Human wins)", 0);
            }

        } else {

            long long y = get_win_move();
            cout << y << endl;

            int k;
            if (!(cin >> k)) finish(_wa, "Unexpected EOF reading pile index", -1);
            if (k < 1 || k > 3) finish(_wa, "Invalid pile index", -1);
            if (k == last_idx) finish(_wa, "Same pile chosen twice consecutively", -1);

            p[k] += y;
            last_idx = k;

            if (check_collision()) {
                finish(_wa, "Human made piles equal", -1);
            }
        }
    }

    if (human_is_first) {

        finish(_wa, "Limit reached without Human winning", -1);
    } else {

        finish(_ok, "Human survived 1000 turns", 0);
    }

    return 0;
}

#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[]) {
    registerGen(argc, argv, 1);

    string mode = opt<string>("mode", "non");

    long long seedVal = 0;
    if (argc > 1) seedVal = atoll(argv[1]);

    vector<int> p;

    if (seedVal >= 1 && seedVal <= 5) {
        if (seedVal == 1) {

            p = {1, 2, 3};
        } else if (seedVal == 2) {

            p = {1000000000 - 2, 1000000000 - 1, 1000000000};
        } else if (seedVal == 3) {

            p = {1, 500000001, 1000000000};
        } else if (seedVal == 4) {

            p = {1, 2, 1000000000};
        } else {

            p = {1000000000, 500000000, 250000000};
        }
    }
    else {

        set<int> s;
        while (s.size() < 3) {
            int x;
            if (mode == "adp") {

                if (rnd.next(10) < 7) {
                    x = rnd.next(900000000, 1000000000);
                } else {
                    x = rnd.next(1, 1000000000);
                }
            } else {

                x = rnd.next(1, 1000000000);
            }
            s.insert(x);
        }
        for (int x : s) p.push_back(x);

        shuffle(p.begin(), p.end());
    }

    println(p[0], p[1], p[2]);

    return 0;
}


This task is interactive. After printing each line, you should flush the output buffer. You can use cout << flush in $\mathrm { C } + +$ , System.out.flush() in Java, and sys.stdout.flush() in Python. You must strictly follow the instructions in the Interaction section; otherwise you may receive verdicts like wrong answer, time limit exceeded, or others.

Since all the tasks have mythical dwarves as their main characters, it may be worth finally thinking about something tangible.

There is a hidden sequence $A$ of length $N$ consisting of integers in the range $[ 0 , 2 ^ { N } - 1 ]$ . Your task is to recover it using a limited number of queries. In each query, you provide a sequence $B$ of length $N$ with elements in the range $[ 0 , 2 ^ { N } - 1 ]$ . The response is computed as follows:

• Sequence $C$ is created where the $i$ -th element of $C$ is the bitwise xor of the $i$ -th elements of $A$ and $B$ . We denote xor by $\bigoplus$ .
• Set $S$ is constructed as the set of all values obtainable by xoring some subset of elements of $C$ . In particular, for the empty subset, the xor is 0.
• The answer to the query is $| S |$ .

For example, if $A = ( 1 , 4 , 3 )$ and $B = ( 0 , 4 , 7 )$ , then $C = ( 1 \oplus 0 , 4 \oplus 4 , 3 \oplus 7 ) = ( 1 , 0 , 4 )$ and $S = \{ 0 , 1 , 4 , 5 \}$ so the answer is 4.

The bitwise xor of two numbers $x$ and $y$ has bit $i$ set if and only if exactly one of $x$ and $y$ has bit $i$ set.
For example, $5 \oplus 3 = ( 1 0 1 ) _ { 2 } \oplus ( 0 1 1 ) _ { 2 } = ( 1 1 0 ) _ { 2 } = 6 $ . In C++ and Python, xor is the operator ˆ.

# Interaction Protocol

The sequence $A$ is fixed at the start and does not depend on the queries made.

First, read a line containing one integer $1 \leq N \leq 6 0$ . Then you may ask queries.

To ask a query, print a line containing ? followed by $N$ integers in the range $[ 0 , 2 ^ { N } - 1 ]$ . In response, read one integer being the answer.

When ready, print ! followed by the $N$ integers of the hidden sequence. Then your program should exit without further output.

Remember to flush after each query and after writing the answer. Put spaces between numbers and the ?, ! symbols.

# Sample interaction

The first sample test has $N = 3$ and $A = ( 1 , 3 , 4 )$ :

Input	Output	Explanation

3	？123	N=3 B= (1,2,3) C = (1④1,3④2,4④3)= (0,1,7)

4	？00。	S = {0,1,6,7}, so the answer is 4 B = (0,0,0)

8	！134	C = (1④0,3④0,4④0)=(1,3,4) S = {0,1,...7}, so the answer is 8 The hidden sequence is A= (1,3,4)

# Local testing

In the Files section you can find B.zip containing sample tests and a grader grader.cpp. To test your solution, compile it, then pass the test name and your executable to the compiled ./grader:

./grader [test] [executable]

For example: ./grader 0b.in ./abc

The sample grader is not guaranteed to behave identically to the official one. However, neither is adaptive.

#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;

static long long queries = 0;

static long long query_limit = 5000;

static void log_metrics() {
    try {
        tout << "queries=" << queries << endl;
        tout << "query_limit=" << query_limit << endl;
    } catch (...) {}
}

static void finish(TResult verdict, const string& msg) {
    log_metrics();
    quitf(verdict, "%s", msg.c_str());
}

static int compute_rank(const vector<long long>& vecs) {
    vector<long long> basis;
    for (long long x : vecs) {
        for (long long b : basis) {
            x = min(x, x ^ b);
        }
        if (x > 0) {
            basis.push_back(x);

            sort(basis.rbegin(), basis.rend());
        }
    }
    return (int)basis.size();
}

int main(int argc, char** argv) {

    registerInteraction(argc, argv);
    atexit(log_metrics);

    int n = inf.readInt(1, 60, "N");
    vector<long long> A(n);
    for (int i = 0; i < n; ++i) {

        long long max_val = (n == 60) ? ((1LL << 60) - 1) : ((1LL << n) - 1);
        A[i] = inf.readLong(0LL, max_val, format("A[%d]", i));
    }

    cout << n << endl;

    long long hard_cap = 200000;

    while (true) {

        if (queries > hard_cap) {
            finish(_pe, "Hard query cap exceeded");
        }

        string token;

        if (!(cin >> token)) {
            finish(_pe, "Unexpected end of stream (expected query or answer)");
        }

        bool is_answer = false;
        vector<long long> B(n);

        if (token == "!") {
            is_answer = true;
            for (int i = 0; i < n; ++i) {
                if (!(cin >> B[i])) finish(_pe, "Failed to read answer element");
            }
        } else if (token == "?") {
            queries++;
            if (queries % 100 == 0) log_metrics();
            for (int i = 0; i < n; ++i) {
                if (!(cin >> B[i])) finish(_pe, "Failed to read query element");
            }
        } else {

            queries++;
            if (queries % 100 == 0) log_metrics();

            try {
                size_t idx = 0;
                B[0] = stoll(token, &idx);
                if (idx != token.size()) finish(_pe, "Invalid token in query: " + token);
            } catch (...) {
                finish(_pe, "Invalid number format: " + token);
            }

            for (int i = 1; i < n; ++i) {
                if (!(cin >> B[i])) finish(_pe, "Failed to read query element");
            }
        }

        if (is_answer) {

            bool ok = true;
            for (int i = 0; i < n; ++i) {
                if (A[i] != B[i]) {
                    ok = false;
                    break;
                }
            }
            if (ok) finish(_ok, "Correct sequence recovered");
            else finish(_wa, "Incorrect sequence");
        } else {

            vector<long long> C(n);
            for (int i = 0; i < n; ++i) {
                C[i] = A[i] ^ B[i];
            }

            int r = compute_rank(C);
            cout << (1LL << r) << endl;
        }
    }

    return 0;
}

#include "testlib.h"
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char* argv[]) {

    registerGen(argc, argv, 1);

    string mode = opt<string>("mode", "non");

    long long seed = atoll(argv[1]);

    int n;
    vector<long long> a;

    if (seed == 1) {

        n = 1;
        a.push_back(rnd.next(0LL, 1LL));
    } else if (seed == 2) {

        n = 2;
        a = {1LL, 1LL};
    } else if (seed == 3) {

        n = 60;
        for (int i = 0; i < n; ++i) a.push_back(1LL << i);
        shuffle(a.begin(), a.end());
    } else if (seed == 4) {

        n = 60;
        a.assign(n, 0);
    } else if (seed == 5) {

        n = 60;
        long long b1 = rnd.next(0LL, (1LL << 60) - 1);
        long long b2 = rnd.next(0LL, (1LL << 60) - 1);
        for (int i = 0; i < n; ++i) a.push_back(rnd.next(0, 1) ? b1 : b2);
    } else {

        int t = rnd.next(1, 100);
        if (t <= 5) n = rnd.next(1, 5);
        else if (t <= 15) n = rnd.next(6, 20);
        else n = rnd.next(21, 60);

        a.resize(n);
        int strat = rnd.next(1, 4);

        if (strat == 1) {

            for (int i = 0; i < n; ++i) {
                if (n == 60) a[i] = rnd.next(0LL, (1LL << 60) - 1);
                else a[i] = rnd.next(0LL, (1LL << n) - 1);
            }
        } else if (strat == 2) {

            int r = rnd.next(1, max(1, n / 2));
            vector<long long> basis(r);
            for (int i = 0; i < r; ++i) {
                if (n == 60) basis[i] = rnd.next(0LL, (1LL << 60) - 1);
                else basis[i] = rnd.next(0LL, (1LL << n) - 1);
            }
            for (int i = 0; i < n; ++i) {
                long long val = 0;
                for (auto x : basis) if (rnd.next(0, 1)) val ^= x;
                a[i] = val;
            }
        } else if (strat == 3) {

            for (int i = 0; i < n; ++i) {
                if (i > 0 && rnd.next(0, 3) > 0) a[i] = a[rnd.next(0, i - 1)];
                else {
                    if (n == 60) a[i] = rnd.next(0LL, (1LL << 60) - 1);
                    else a[i] = rnd.next(0LL, (1LL << n) - 1);
                }
            }
        } else {

            for (int i = 0; i < n; ++i) {
                long long val = 0;
                int bits = rnd.next(0, min(n, 5));
                for (int k = 0; k < bits; ++k) val |= (1LL << rnd.next(0, n - 1));
                a[i] = val;
            }
        }
    }

    if (mode == "adp") {

        cout << n << endl;
    } else {

        cout << n << endl;
        for (int i = 0; i < n; ++i) {
            cout << a[i] << (i == n - 1 ? "" : " ");
        }
        cout << endl;
    }

    return 0;
}