#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define vc vector
#define F first
#define S second
#define yes cout << "YES" << "\n"
#define no cout << "NO" << "\n"
#define el "\n"
#define pb push_back
#define pf push_front
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fr(i,x,n) for(int i = x ; i< n ;i++)
#define cin(v) for(auto& ele : v)cin>>ele
#define print(v) for(auto& ele : v)cout << ele << ' '
#define test(x,y) cout << x << ' ' << y << "\n"
#define debug(x) cout << "x : " << x << el
#define vc2Dint vector<vector<int>>
#define vc2Dll vector<vector<long long>>
#define cin2D(v) for(auto& row : (v))for(auto& col : row)cin>>col
#define print2D(v) for(auto& row : v){for(auto& col: row)cout << col << ' ';cout << el;}
#define flush cout << flush
using namespace std;
// math equation is (a*n^2)+(b*n)+c = 0 : (-b±√(b²-4ac))/(2a) : (-b +/- sqrt(b^2 - 4*a*c))/2*a;
//sum form 1 to n in o(1)
//0 -> n : (n*(n+1))/2;
//0 -> n reversed if he gives you the sum and want the number ((-1+sqrt(1+(8*n)))/2) -> he give you 15 and want to get the number that sum is 15 it is 5.
//0 -> n ODD : ((n+1)/2)*((n+1)/2);
//0 -> n EVEN : (n/2)*((n/2)+1);
//0 -> n that is divisible by x : ((n / x)) * (2 * x + (n / x - 1) * x) / 2;
//0 -> n of fibonacci numbers is : fib(n+2)-1;
//count numbers from 1 to n
// n EVEN : n/2;
// n ODD : (n+1)/2;
// arithmetic progression
// an = a + (n-1) * d ;
// a -> first term , n -> number of terms , d -> common difference
// ex : 1,3,5,7,9,....
// a4 = 1 + (4-1) * 2 = 7
// ceil(x/y) = (x+y-1)/y
// ASCII : A->Z ( 65 <= x && x <= 90) , a->z (97 <= x && x <= 122)
bool getBit(ll x, ll idx) { return x & (1LL << idx); }
int setBit1(int x, int idx) { return x | (1 << idx); }
int setBit0(int x, int idx) { return x & ~(1 << idx); }
int toggleBit(int x, int idx) { return x ^ (1 << idx); }
int cntBit(int x)
{
int cnt = 0;
while (x)
{
if (x % 2)cnt++;
x /= 2;
}
return cnt;
}
string fromDeci(ll n, ll base) {
if (n == 0) return "0";
string res = "";
while (n > 0) {
int rem = n % base;
if (rem < 10) res += (rem + '0');
else res += (rem - 10 + 'A');
n /= base;
}
reverse(res.begin(), res.end());
return res;
}
ll toDeci(string n,ll base){
ll result = 0;
ll base_power = 1;
for(int i = n.size() - 1; i >= 0; i--) {
int digit_value;
if(n[i] >= '0' && n[i] <= '9') {
digit_value = n[i] - '0';
} else {
digit_value = n[i] - 'A' + 10;
}
result += digit_value * base_power;
base_power *= base;
}
return result;
}
// ================================== bitmask built in functions ==================================
// __builtin_popcount(unsigned int)returns the number of set bits
// __builtin_ffs(int) finds the index of the first (most right) set bit
// __builtin_ctz(unsigned int) the count of trailing zeros(right zeros)
// __builtin_clz(unsigned int) the count of leading zeros (left zeros)
// ================================== math theory functions ==================================
//12351362143262364334723457224234543237632456 + 416324274732532425243725344352426234
// sum very big numbers
struct BigInteger {
string str;
// Constructor to initialize
// BigInteger with a string
BigInteger(string s) { str = s; }
// Overload + operator to add
// two BigInteger objects
BigInteger operator+(const BigInteger& b)
{
string a = str;
string c = b.str;
int alen = a.length(), clen = c.length();
int n = max(alen, clen);
if (alen > clen)
c.insert(0, alen - clen, '0');
else if (alen < clen)
a.insert(0, clen - alen, '0');
string res(n + 1, '0');
int carry = 0;
for (int i = n - 1; i >= 0; i--) {
int digit = (a[i] - '0') + (c[i] - '0') + carry;
carry = digit / 10;
res[i + 1] = digit % 10 + '0';
}
if (carry == 1) {
res[0] = '1';
return BigInteger(res);
}
else {
return BigInteger(res.substr(1));
}
}
// Overload << operator to output
// BigInteger object
friend ostream& operator<<(ostream& out,
const BigInteger& b)
{
out << b.str;
return out;
}
};
vc<ll> getDivisors(ll n)
{
vc<ll> v;
ll i = 1;
for (; i * i < n; i++)
{
if (n % i == 0)
{
v.pb(i);
v.pb(n / i);
}
}
if (i * i == n)v.pb(i);
return v;
}
vc<bool> sieve(ll n)
{
vc<bool> is_prime(n + 1, true);
is_prime[0] = is_prime[1] = false;
for (int i = 2; i * i <= n; i++)
{
if (is_prime[i]) { for (int j = i * i; j <= n; j += i)is_prime[j] = false; }
}
return is_prime;
}
vc<ll> SieveOfEratosthenes(ll n)
{
vc<ll> primes;
vc<bool> is_prime = sieve(n);
for(ll i = 2; i < n + 1; i++)
{
if (is_prime[i])
primes.pb(i);
}
return primes;
}
bool isPrime(ll number)
{
if (number < 2) { return false; }
if (number == 2 || number == 3 || number == 5) { return true; }
if (number % 2 == 0 || number % 3 == 0 || number % 5 == 0) { return false; }
for (ll i = 5; i * i <= number; i += 6) { if (number % i == 0 || number % (i + 2) == 0) { return false; } }
return true;
}
vc<ll> primeFactorization(ll n){
vc<ll> result;
while(n % 2 == 0)
{
result.pb(2);
n = n/2;
}
for(ll i = 3; i*i <= n; i = i + 2)
{
while(n % i == 0)
{
result.pb(i);
n = n/i;
}
}
if(n > 2)
result.pb(n);
return result;
}
ll absMod(ll x , ll mod){return ((x%mod)+mod) % mod;}
ll add(ll a,ll b,ll m) { return ((a % m) + (b % m)) % m; }
ll mul(ll a,ll b,ll m) { return ((a % m) * (b % m)) % m; }
ll sub(ll a,ll b,ll m) { return ((a % m) - (b % m) + m) % m; }
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
ll factorial(ll n)
{
if (n == 0)return 1;
ll i = n, fact = 1;
while (n / i != n)
{
fact = fact*i;
i--;
}
return fact;
}
ll npr(ll n, ll r) { return factorial(n) / factorial(n - r); }
ll ncr(ll n, ll r) { return npr(n, r) / factorial(r); }
// ================================== random functions ==================================
void srour()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
}
ll power(ll x, ll y,ll mod)
{
ll res = 1;
while (y > 0)
{
if (y % 2 == 1)res = mul(res,x,mod);
y = y >> 1;
x = mul(x,x,mod);
}
return res;
}
ll power(ll x, ll y){
ll res = 1;
while (y > 0)
{
if (y % 2 == 1)res *= x;
y = y >> 1;
x *= x;
}
return res;
}
bool isDivisibleByPowerOf2(int n, int k) { return (n & (1 << k - 1)) == 0; }
bool isPowerOfTwo(unsigned ll n) { return n && !(n & (n - 1)); }
/*
██████ ██▀███ ▒█████ █ ██ ██▀███
▒██ ▒ ▓██ ▒ ██▒▒██▒ ██▒ ██ ▓██▒▓██ ▒ ██▒
░ ▓██▄ ▓██ ░▄█ ▒▒██░ ██▒▓██ ▒██░▓██ ░▄█ ▒
▒ ██▒▒██▀▀█▄ ▒██ ██░▓▓█ ░██░▒██▀▀█▄
▒██████▒▒░██▓ ▒██▒░ ████▓▒░▒▒█████▓ ░██▓ ▒██▒
▒ ▒▓▒ ▒ ░░ ▒▓ ░▒▓░░ ▒░▒░▒░ ░▒▓▒ ▒ ▒ ░ ▒▓ ░▒▓░
░ ░▒ ░ ░ ░▒ ░ ▒░ ░ ▒ ▒░ ░░▒░ ░ ░ ░▒ ░ ▒░
░ ░ ░ ░░ ░ ░ ░ ░ ▒ ░░░ ░ ░ ░░ ░
░ ░ ░ ░ ░ ░
================================================== start of code ==================================================
*/
/*
------------>>> First thing you should think <<<---------------
ACE -> very easy problem.
implementation -> solve only without thinking of algorithm.
greedy -> try to find pattern in the problem.
math -> try to find a formula for the problem.
------------>>> Second thing you should think <<<---------------
STLs:-
sequential containers
$ vector -> one direction dynamic array can v.(puch_back,pop_back,front,back,begin,end,erase)
$ deque -> multi direction dynamic array can dq.(push_back,pop_back,push_front,pop_front,front,back,begin,end)
$ array -> array<type,sizeOfArray> used for fixed multidimensional array vc<array<int,5>>
container adapters
$ stack -> LIFO(last in first out)
- used for problems that connect two element together like "(),{},[]" it can also be numbers.
$ queue -> FIFO(first in last out)
- used for problems that
$ priority_queue -> sort all elements increasing by default priority_queue<int,vc<int>,greater<int>> to reverse
associative container
$ set -> unique and sorted data structure st.(insert,erase(val),find)
$ multiset -> sorted data structure like a priority queue but can access to any element.
$ map ->
prefix sum:-
...........IDK.
Binary search:-
$ lower_bound -> get the number or the number next to ex : *lower_bound(5) = 5 -> [2,3,5,7,8]
$ upper_bound -> get the next number ex: *upper_bound(5) = 7 -> [2,3,5,7,8]
$ binary search on ranges ->
$ binary search on answer ->
Bitmask:-
$ greedy -> most of time bitmask problems solved by patterns.
$ ACE -> should know some formulas like : .....Forgot.
number theory:-
$ GCD ->
$ LCM ->
$ Implementation ->
--------------------------------------- tips && tricks ---------------------------------------
1-erase(unique(all(v)),v.end()) -> remove repeated elements in the array sequentially [1,1,2,2,3,2,1] -> [1,2,3,2,1]
2-sort(all(v)) -> erase(unique(all(v)),v.end()) -> remove all repeated elements in the hole array [1,1,2,2,3,2,1] -> [1,2,3]
*/
ll mod = 1e9+7, oo = 0x3f3f3f3f;
const double PI = acosl(-1.0l);
const int dx[] = {0,0,1,-1/*,1,-1,1,-1*/};
const int dy[] = {1,-1,0,0/*,1,-1,-1,1*/};
const double EPS = 1e-7;//epsilon
const int N = 2e5+5;
// interactive
string ask(int md){
cout << md << el;
flush;
string x;cin>>x;
return x;
}
/*
data type range
data structure
algorithm
======== test Cases ========
Input:
10 5
2 3 0 0 0 2 3 1 1 0
7
1 2
1 3
1 7
1 10
2 7
2 6
3 8
Output:
*/
void solve(){
int op = 30;
int l = 0 ,r = 1e9;
while(op-- && l <= r){
int md = (l+r)>>1;
string res = ask(md);
if(res == "=")return void(cout << "! " << md << el);
else if(res == ">")l = md+1;
else r = md-1;
}
}
//-------------------- tips and tricks -------------------------
// BEFORE coding are you sure you understood the statement correctly?
// PLEASE do not forget to read the sample explanation carefully.
// WATCH out for overflows & RTs in general.
// TEST your idea or code on the corner cases.
// ANALYZE each idea you have thoroughly.
// IS not binary search on answer?
// IF there is subtasks in the problem.
int main(){
// freopen("mosalah.in", "r", stdin);
// freopen("Output.in", "w", stdout);
srour();
int t = 1;
// cin>>t;
while (t--)
solve();
return 0;
}