// TEMPLATE - START
// ----------------------------------------------------
using namespace std;
// ----------------------------------------------------
// DEFINES - START
#include <bits/stdc++.h>
#define FAST                      \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);
// Strings
#define nl endl
#define bl cout << endl
#define YES cout << "YES\n"
#define NO cout << "NO\n"
#define yn(x) \
    if (x)    \
        YES;  \
    else      \
        NO;
#define yns(x, s1, s2)      \
    if (x)                  \
        cout << s1 << "\n"; \
    else                    \
        cout << s2 << "\n";
#define fail(cond) \
    if (cond)      \
        return void(NO);
#define success(cond) \
    if (cond)         \
        return void(YES);
#define fail(cond, s) \
    if (cond)         \
        return void(cout << s << nl);
#define success(cond, s) \
    if (cond)            \
        return void(cout << s << nl);
// Types
#define ll long long
#define ld long double
#define ull unsigned long long
#define vl vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pair<ll, ll>>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
// Loops
#define lp(i, a, b) for (int i = (a); i < (b); i++)
#define rlp(i, a, b) for (int i = (b) - 1; i >= (a); i--)
#define readlp(arr, n) \
    lp(i, 0, n) cin >> arr[i];
#define writelp(arr, n)                \
    lp(i, 0, n) cout << arr[i] << " "; \
    bl;
#define write(v)          \
    for (auto x : v)      \
        cout << x << " "; \
    bl;
#define vv    \
    ll n;     \
    cin >> n; \
    vl v(n);  \
    readlp(v, v.size());
// DEFINES - END
// ----------------------------------------------------
// DATA_STRUCTURES - START
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

// Ordered set (no duplicates, ordered by Key)
template <class Key>
using ordered_set = tree<Key, null_type, less<Key>, rb_tree_tag, tree_order_statistics_node_update>;

// Ordered multi-set (allows duplicates, ordered by Key)
template <class Key>
using ordered_multi_set = tree<Key, null_type, less_equal<Key>, rb_tree_tag, tree_order_statistics_node_update>;

// Ordered map (Key -> Value, ordered by Key)
template <class Key, class Val>
using ordered_map = tree<Key, Val, less<Key>, rb_tree_tag, tree_order_statistics_node_update>;
// DATA_STRUCTURES - END
// ----------------------------------------------------
// ALGORITHMS - START
// Binary Search Custom:
// To Find...,Logical Condition,If Condition is Met...,Return Value
// Lower Bound (First element ≥x),arr[m] >= x,r = m,r
// Upper Bound (First element >x),arr[m] > x,r = m,r
// Last element <x,arr[m] < x,l = m,l
// Last element ≤x,arr[m] <= x,l = m,l

ll lowerBound(vector<ll> &v, ll x)
{
    ll l = -1, r = v.size();
    while (r > l + 1)
    {
        ll m = l + (r - l) / 2;
        ll curr = v[m];
        if (curr >= x)
            r = m;
        else
            l = m;
    }
    return r;
}
// ALGORITHMS - END
// ----------------------------------------------------
// TEMPLATE END

// ====================================================

// Boody's Code
// 2026-08-17, 15:49:32
// Codeforces - The 2026 ICPC Egyptian Collegiate Programming Contest (Qualifications - Day 5)
// L. The Blind Artillery
// https://c...content-available-to-author-only...s.com/group/Rilx5irOux/contest/710922/problem/L
// Time limit: 00, Memory limit: 5
// status:
// Time taken:2

// ----------------------------------------------------
ll lo, m1, m2, hi;
ll ans1 = -1, ans2 = -1;

pll f(ll t)
{
    cout << "? " << t << nl;
    ll p, d;
    cin >> p >> d;
    return {p, d};
}

void lowerBoundt()
{
    ll l = lo - 1, r = hi + 1;
    while (r > l + 1)
    {
        ll m = l + (r - l) / 2;
        pll curr = f(m);
        if (curr.first == -1)
        {
            if (curr.second == 1)
                lo = m + 1, l = m;
            else
                hi = m - 1, r = m;
        }
        else if (curr.first == 1)
        {
            m1 = m - 1, m2 = m + 1;
            break;
        }
        else
        {
            if (curr.second == 1)
                ans1 = m, m2 = m + 1, m1 = m;
            else
                ans2 = m, m1 = m - 1, m2 = m;
            break;
        }
    }
}

ll lowerBoundt1(ll s, ll e)
{
    ll l = s - 1, r = e + 1;
    while (r > l + 1)
    {
        ll m = l + (r - l) / 2;
        pll curr = f(m);
        if (curr.first == 0)
            r = m, l = m - 1;
        else if (curr.first == -1)
            l = m;
        else
            r = m;
    }
    return r;
}

ll lowerBoundt2(ll s, ll e)
{
    ll l = s - 1, r = e + 1;
    while (r > l + 1)
    {
        ll m = l + (r - l) / 2;
        pll curr = f(m);
        if (curr.first == 0)
            l = m, r = m + 1;
        else if (curr.first == -1)
            r = m;
        else
            l = m;
    }
    return l;
}

void solve()
{
    lo = 1, hi = 1e9, ans1 = -1, ans2 = -1;
    lowerBoundt();
    if (ans1 == -1)
        ans1 = lowerBoundt1(lo, m1);
    if (ans2 == -1)
        ans2 = lowerBoundt2(m2, hi);
    cout << "! " << ans1 << " " << ans2 << nl;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("/home/rodex/rubuntu/CS/CP/input.txt", "r", stdin);
    freopen("/home/rodex/rubuntu/CS/CP/output.txt", "w", stdout);
#endif
    FAST;

    int t = 1;
    cin >> t;
    while (t--)
        solve();
}
