#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v] && !disc[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx)
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = 0;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s,	int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		del(cur, nxt, n);
		cur = ask(cur, nxt);
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		int gt = ask(cur, nxt);
		if(gt == a || gt == b)return cout << "! " << gt << endl,0;
		cur = bfs(cur);
		nxt = bfs(cur);
		disc[cur] = disc[nxt] = 1;
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = 1;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		int gt = ask(cur, nxt);
		if(gt == cur || gt == nxt)return cout << "! " << gt << endl,0;
		cur = bfs(cur);
		nxt = bfs(cur);
		disc[cur] = disc[nxt] = 1;
	}
        for(int i = 1; i <= n; i++)
        {
                if(!disc[i])
                {
                        return cout << "! " << i << endl,0;
                }
        }
	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v] )
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = INT_MAX;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s, int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		del(cur, nxt, n);
		cur = ask(cur, nxt);
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = -1;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;
	int ans = 1;
	while (n--)
	{
	        disc[cur] = disc[nxt] = 1;
		ans = ask(cur, nxt);
		cur = bfs(cur);
		if(cur == -1)break;
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = 1;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		int gt = ask(cur, nxt);
		if(gt == cur || gt == nxt)return cout << "! " << gt << endl,0;
		cur = bfs(cur);
		nxt = bfs(cur);
		disc[cur] = disc[nxt] = 1;
	}
        for(int i = 1; i <= n; i++)
        {
                if(!dis[i])
                {
                        return cout << "! " << i << endl,0;
                }
        }
	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v] && !disc[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx)
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = INT_MAX;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s,	int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		del(cur, nxt, n);
		cur = ask(cur, nxt);
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		int gt = ask(cur, nxt);
		if(gt == cur || gt == nxt)return cout << "! " << gt << endl,0;
		cur = bfs(cur);
		nxt = bfs(cur);
		disc[cur] = disc[nxt] = 1;
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111];
bool vis[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				if (lvl[v] > mx)
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		cur = ask(cur, nxt);
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	if (disc[u])return u;
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v] && !disc[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx)
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = INT_MAX;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s, int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{

		if(cur != nxt)
			del(cur, nxt, n);
		cur = ask(cur, nxt);

		for (int i = 1; i <= n; i++)
		{
			if (!disc[i])
			{
				cur = i;
				break;
			}
		}
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && g[v].size() == 1 && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = 0;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s, int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	int cur, nxt;
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	cur = bfs(cur), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		del(cur, nxt, n);
		int as = ask(cur, nxt);
		if(as == cur || as == nxt)return cout << "! " << as << endl,0;
		for (int i = 1; i <= n; i++)if (g[i].size() == 1 && !disc[i])cur = i;
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v] )
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
        lvl[src] = 0;
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = INT_MAX;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s, int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		del(cur, nxt, n);
		cur = ask(cur, nxt);
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	if (disc[u])return 0;
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = u;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v] && !disc[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx)
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

bool BFS(int src, int dest)
{
	queue<int> q;
	for (int i = 0; i <= n + 10; i++) {
		lvl[i] = INT_MAX;
		p[i] = -1;
	}
	memset(vis, false, sizeof(vis));
	vis[src] = true;
	p[src] = 0;
	q.push(src);

	while (!q.empty()) {
		int u = q.front();
		q.pop();
		for (int i = 0; i < g[u].size(); i++) {
			if (vis[g[u][i]] == false)
			{
				vis[g[u][i]] = true;
				lvl[g[u][i]] = lvl[u] + 1;
				p[g[u][i]] = u;
				q.push(g[u][i]);
				if (g[u][i] == dest)
					return true;
			}
		}
	}

	return false;
}

void del(int s, int dest, int v)
{

	if (BFS(s, dest) == false)
	{
		return;
	}

	vector<int> path;
	int crawl = dest;
	path.push_back(crawl);
	while (p[crawl] != -1) {
		path.push_back(p[crawl]);
		crawl = p[crawl];
	}

	for (int i = path.size() - 1; i >= 0; i--)
		disc[path[i]] = 1;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;

	while (n--)
	{
		del(cur, nxt, n);
		cur = ask(cur, nxt);

		for (int i = 1; i <= n; i++)
		{
			if (!disc[i])
			{
				cur = i;
				break;
			}
		}
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <iostream>
#include <algorithm>
#include <iomanip>
#include <cstring>
#include <memory.h>
#include <math.h>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>
#include <queue>
//#include <stack>
#include <cstdio>
#include <bitset>

using namespace std;

#define nfs ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define f first
#define s second
#define m_p make_pair
#define pb push_back
#define ii pair<int,int>
#define iii pair<int,pair<int,int> >
#define ll long long
#define ull unsigned long long
#define ld long double
#define ef else if
#define loc(x) (x).begin(),(x).end()
#define locR(x) (x).rbegin(),(x).rend()
#define no puts("NO")
#define yes puts("YES")
#define ex puts("-1")
#define en puts("")
#define _ cout
#define __ <<
#define outV(v) for(int i = 0 ; i < v.size() ; i++)cout << v[i] << ' ';
#define outA(x,l,r) for(int i = l ; i < r ; i++)cout << x[i] << ' ';

#ifndef ONLINE_JUDGE
#define scanf scanf_s
#endif

const ld EPS = 1e-18;
const double DEPS = 1e-9;
const ld PI = 3.141592653589793238;
const ll MOD = 1000000007;
const int N = (int)(5e5) + 10;

void inp()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "inp.txt", "r", stdin);
#endif
}

void out()
{
#ifndef ONLINE_JUDGE
	FILE* stream;
	freopen_s(&stream, "out.txt", "w", stdout);
#endif
}

ll gcd(ll fx, ll fy)
{
	if (!fy) return fx;
	return gcd(fy, fx % fy);
}

inline void fill(int* ar, int sz, int val)
{
	for (int i = 0; i < sz; i++)
	{
		ar[i] = val;
	}
}

int n, lvl[1111], p[1111];
bool vis[1111], disc[1111];
vector<vector<int> >g;

int bfs(int u)
{
	memset(vis, false, sizeof(vis));
	memset(lvl, false, sizeof(lvl));
	queue<int>q;
	q.push(u);
	vis[u] = 1;
	int mx = 0, id = -1;
	while (q.size())
	{
		int fr = q.front();
		q.pop();
		for (int i = 0; i < g[fr].size(); i++)
		{
			int v = g[fr][i];
			if (!vis[v])
			{
				q.push(v);
				vis[v] = 1;
				lvl[v] = 1 + lvl[fr];
				p[v] = u;
				if (lvl[v] > mx && !disc[v])
				{
					mx = lvl[v];
					id = v;
				}
			}
		}
	}

	return id;
}

int ask(int x, int y)
{
	cout << "? " << x << ' ' << y << endl;
	int gt = 0;
	cin >> gt;
	return gt;
}

int main()
{
	//inp();
	cin >> n;
	g.resize(n + 1);
	for (int x, y, i = 1; i < n; i++)
	{
		scanf("%d%d", &x, &y);
		g[x].pb(y);
		g[y].pb(x);
	}

	int cur = bfs(1), nxt = bfs(cur);
	n /= 2;
	int ans = 1;
	while (n--)
	{
	        disc[cur] = disc[nxt] = 1;
		ans = ask(cur, nxt);
		if(ans == cur || ans == nxt)
		{
		        return cout << "! " << ans << endl,0;
		}
		cur = bfs(cur);
		if(cur == -1)break;
		nxt = bfs(cur);
	}

	cout << "! " << cur << endl;
}

/*10
1 2
2 3
2 5
3 4
5 6
6 7
7 8
8 9
9 10*/


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001], a[1001][1001];
int cnt;
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        a[u][v] = a[v][u] = 1;
    }
    cnt = n;
    for (int i = 1; i <= n / 2; i++)
    {
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
        if (cnt == 3)
        {
            break;
        }
    }
    if (n % 2 && cnt == 3)
    {
        vector<int> v;
        cout << "? ";
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                v.pb(i);
            }
        }
        for (int i = 0; i < 3; i++)
        {
            int cnt2 = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[v[i]][v[j]])
                {
                    cnt2++;
                }
            }
            if (cnt2 == 2)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        cout << v[j] << ' ';
                    }
                }
            }
        }
        cout << endl;
        cout << flush;
        cin >> w;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001], a[1001][1001];
int cnt;
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        a[u][v] = a[v][u] = 1;
    }
    cnt = n;
    if (n != 3)
    {
        for (int i = 1; i <= n / 2 - n % 2; i++)
        {
            pair<int, int> q = query();
            if (q.fi == -1 || q.se == -1)
            {
                break;
            }
            cout << "? " << q.fi << ' ' << q.se << endl;
            cout << flush;
            cin >> w;
            check[w] = 1;
            if (w != q.fi)
            {
                dfs(q.fi);
            }
            if (w != q.se)
            {
                dfs(q.se);
            }
            check[w] = 0;
            if (cnt == 3)
            {
                break;
            }
        }
    }
    if (cnt == 3)
    {
        vector<int> v;
        cout << "? ";
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                v.pb(i);
            }
        }
        for (int i = 0; i < 3; i++)
        {
            int cnt2 = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[v[i]][v[j]])
                {
                    cnt2++;
                }
            }
            if (cnt2 == 2)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        cout << v[j] << ' ';
                    }
                }
            }
        }
        cout << endl;
        cout << flush;
        cin >> w;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001], a[1001][1001];
int cnt;
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        a[u][v] = a[v][u] = 1;
    }
    cnt = n;
    for (int i = 1; i <= n / 2; i++)
    {
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
        if (cnt == 3)
        {
            break;
        }
    }
    if (cnt == 3)
    {
        vector<int> v;
        cout << "? ";
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                v.pb(i);
            }
        }
        for (int i = 0; i < 3; i++)
        {
            int cnt2 = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[v[i]][v[j]])
                {
                    cnt2++;
                }
            }
            if (cnt2 == 2)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        cout << v[j] << ' ';
                    }
                }
            }
        }
        cout << endl;
        cout << flush;
        cin >> w;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001], a[1001][1001];
bool visit[1001];
int cnt;
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i] && !visit[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i] && !visit[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        a[u][v] = a[v][u] = 1;
    }
    cnt = n;
    for (int i = 1; i <= n / 2 - n % 2; i++)
    {
        if (cnt == 3)
        {
            break;
        }
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        visit[q.fi] = visit[q.se] = 1;
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
    }
    if (cnt == 3)
    {
        vector<int> v;
        cout << "? ";
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                v.pb(i);
            }
        }
        for (int i = 0; i < 3; i++)
        {
            int cnt2 = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[v[i]][v[j]])
                {
                    cnt2++;
                }
            }
            if (cnt2 == 2)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        cout << v[j] << ' ';
                    }
                }
            }
        }
        cout << endl;
        cout << flush;
        cin >> w;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001], a[1001][1001];
int cnt;
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        a[u][v] = a[v][u] = 1;
    }
    cnt = n;
    for (int i = 1; i <= n / 2 - n % 2; i++)
    {
        if (cnt == 3)
        {
            break;
        }
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
    }
    if (cnt == 3)
    {
        vector<int> v;
        cout << "? ";
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                v.pb(i);
            }
        }
        for (int i = 0; i < 3; i++)
        {
            int cnt2 = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[v[i]][v[j]])
                {
                    cnt2++;
                }
            }
            if (cnt2 == 2)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        cout << v[j] << ' ';
                    }
                }
            }
        }
        cout << endl;
        cout << flush;
        cin >> w;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
int query()
{
    cout << "? ";
    int u, v;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    cout << u << ' ' << v << endl;
    cout << flush;
    return u;
}
void dfs(int u)
{
    check[u] = 1;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    for (int i = 1; i <= n / 2; i++)
    {
        int u = query();
        cin >> w;
        check[w] = 1;
        dfs(u);
        check[w] = 0;
    }
    cout << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
int query()
{
    cout << "? ";
    int u, v;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    cout << u << ' ' << v << endl;
    cout << flush;
    return u;
}
void dfs(int u)
{
    check[u] = 1;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    for (int i = 1; i <= n / 2; i++)
    {
        int u = query();
        cin >> w;
        check[w] = 1;
        dfs(u);
        check[w] = 0;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    for (int i = 1; i <= n / 2; i++)
    {
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
bool visit[1001];
int cnt;
queue<int> qlist;
void dfs(int u)
{
    visit[u] = 1;
    int cnt = 0;
    for (auto v : adj[u])
    {
        if (!visit[v])
        {
            cnt++;
            dfs(v);
        }
    }
    if (cnt == 0)
    {
        qlist.push(u);
    }
}
void cut(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            cut(i);
        }
    }
}
bool leaf(int u)
{
    int cnt = 0;
    for (auto v : adj[u])
    {
        if (!check[v])
        {
            cnt++;
        }
    }
    if (cnt <= 1)
    {
        return 1;
    }
    return 0;
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    dfs(1);
    for (int i = 1; i <= n / 2; i++)
    {
        if (qlist.size() == 1)
        {
            break;
        }
        int u, v;
        u = qlist.front();
        qlist.pop();
        v = qlist.front();
        qlist.pop();
        cout << "? " << u << ' ' << v << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != u)
        {
            cut(u);
        }
        if (w != v)
        {
            cut(v);
        }
        check[w] = 0;
        if (leaf(w))
        {
            qlist.push(w);
        }
    }
    cout << "! " << qlist.front();
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
int cnt[1001];
queue<int> qlist;
void cut(int u)
{
    check[u] = 1;
    for (auto i : adj[u])
    {
        cnt[i]--;
        if (!check[i])
        {
            cut(i);
        }
    }
}
int getnode()
{
    int u;
    while (check[qlist.front()])
    {
        qlist.pop();
    }
    u = qlist.front();
    qlist.pop();
    return u;
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        cnt[u]++;
        cnt[v]++;
    }
    for (int i = 1; i <= n; i++)
    {
        if (cnt[i] == 1)
        {
            qlist.push(i);
        }
    }
    for (int i = 1; i <= n / 2; i++)
    {
        int u, v;
        u = getnode();
        v = getnode();
        cout << "? " << u << ' ' << v << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != u)
        {
            cut(u);
        }
        if (w != v)
        {
            cut(v);
        }
        check[w] = 0;
        if (cnt[w] == 1)
        {
            qlist.push(w);
        }
        else if (cnt[w] == 0)
        {
            cout << "! " << w << endl;
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001], a[1001][1001];
int cnt;
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    cnt--;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        a[u][v] = a[v][u] = 1;
    }
    cnt = n;
    for (int i = 1; i <= n / 2 - n % 2; i++)
    {
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
        if (cnt == 3)
        {
            break;
        }
    }
    if (cnt == 3)
    {
        vector<int> v;
        cout << "? ";
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                v.pb(i);
            }
        }
        for (int i = 0; i < 3; i++)
        {
            int cnt2 = 0;
            for (int j = 0; j < 3; j++)
            {
                if (a[v[i]][v[j]])
                {
                    cnt2++;
                }
            }
            if (cnt2 == 2)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (i != j)
                    {
                        cout << v[j] << ' ';
                    }
                }
            }
        }
        cout << endl;
        cout << flush;
        cin >> w;
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
pii query()
{
    int u = -1, v = -1;
    int i = 1;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            u = i;
            break;
        }
    }
    i++;
    for (i; i <= n; i++)
    {
        if (!check[i])
        {
            v = i;
            break;
        }
    }
    return make_pair(u, v);
}
void dfs(int u)
{
    check[u] = 1;
    for (auto i : adj[u])
    {
        if (!check[i])
        {
            dfs(i);
        }
    }
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
    }
    for (int i = 1; i <= n / 2; i++)
    {
        pair<int, int> q = query();
        if (q.fi == -1 || q.se == -1)
        {
            break;
        }
        cout << "? " << q.fi << ' ' << q.se << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != q.fi)
        {
            dfs(q.fi);
        }
        if (w != q.se)
        {
            dfs(q.se);
        }
        check[w] = 0;
    }
    if (n % 2 != 0)
    {
        for (int i = 1; i <= n; i++)
        {
            if (!check[i])
            {
                cout << "! " << i << endl;
                return 0;
            }
        }
    }
    cout << "! " << w;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define task "data"

#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define FOD(i, a, b) for (int i = a; i >= b; --i)
#define FRSZ(i, a) for (int i = 0; i < a.size(); ++i)
#define FDSZ(i, a) for (int i = a.size() - 1; i >= 0; --i)
#define debug(x) cout << #x << " = " << x << endl;
#define debugarr(x, n)       \
    {                        \
        FOR(_, 1, n)         \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define debugvi(x)           \
    {                        \
        FRSZ(_, x)           \
        cout << x[_] << " "; \
        cout << endl;        \
    }
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef long long ll;

int n, w;
vector<int> adj[1001];
bool check[1001];
int cnt[1001];
queue<int> qlist;
void cut(int u)
{
    check[u] = 1;
    for (auto i : adj[u])
    {
        cnt[i]--;
        if (!check[i])
        {
            cut(i);
        }
    }
}
int getnode()
{
    int u;
    while (check[qlist.front()])
    {
        qlist.pop();
    }
    u = qlist.front();
    qlist.pop();
    return u;
}
int main()
{
    // freopen("data.inp", "r", stdin);
    // freopen("data.out", "w", stdout);
    cin >> n;
    for (int i = 1; i < n; i++)
    {
        int u, v;
        cin >> u >> v;
        adj[u].pb(v);
        adj[v].pb(u);
        cnt[u]++;
        cnt[v]++;
    }
    for (int i = 1; i <= n; i++)
    {
        if (cnt[i] == 1)
        {
            qlist.push(i);
        }
    }
    for (int i = 1; i <= n / 2; i++)
    {
        cout << qlist.size() << endl;
        int u, v;
        u = getnode();
        v = getnode();
        cout << "? " << u << ' ' << v << endl;
        cout << flush;
        cin >> w;
        check[w] = 1;
        if (w != u)
        {
            cut(u);
        }
        if (w != v)
        {
            cut(v);
        }
        check[w] = 0;
        if (cnt[w] == 1)
        {
            qlist.push(w);
        }
        else if (cnt[w] == 0)
        {
            cout << "! " << w << endl;
            return 0;
        }
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define mai3(a,b,c) mai(a,mai(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m)  for(itx=m.begin();itx!=m.end();itx++)
#define ins insert
 #define INF 1000000000000000000
 #define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 int power(int a,int x)
 {
         a%=mod;
        int res=1;
    while(x>0)
        {
            if(x&1)
            res=res*a%mod;
            a=a*a%mod;
            x>>=1;
        }
    return res;
}
int mai(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
vector<int>v[1005];
int visit[1005],level[1005];
void bfs(int s)
{
    visit[s]=1;
    level[s]=1;
    queue<int>q;
    q.push(s);
    while(!q.empty())
    {
        int p=q.front();
        q.pop();
        for(int i=0;i<v[p].size();i++)
        {
            if(visit[v[p][i]]==0)
            {
                visit[v[p][i]]=1;
                level[v[p][i]]=level[p]+1;
            }
        }
    }
}
int mark[10004];
signed main()
{
    std::vector<int> ::iterator itx;
    int n;cin>>n;
    for(int i=1;i<n;i++)
    {
        int x,y;cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    bfs(1);
    // vector<int>leaf;
    vector<int>t_leaf;
    vector<int>leaf;
    int sta;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()==1)
        {
          sta=i;
            t_leaf.pb(i);
            leaf.pb(i);
        }
    }

    int ans=1;
    int x=n/2;
    vector<int>xx;

    // el
    while(x--)
    {
        if(leaf.size()>=2)
        {
            vector<int>::iterator  it=leaf.begin();
            int x1=*it;
            it++;
            int x2=*it;

            cout<<"? "<<x1<<" "<<x2;el
            int z;cin>>z;
            ans=z;
                if(x1==z||x2==z)
                {
                    ans=z;
                    break;
                }

                leaf.erase(leaf.begin());
                leaf.erase(leaf.begin());

        }
        else
        {
            if(leaf.size()==1)
            {
              vector<int>::iterator  it=leaf.begin();
               ans=*it;
               leaf.clear();
              for(int i=0;i<t_leaf.size();i++)
              {
                int lol=t_leaf[i];
                for(int j=1;j<=n;j++)
                {
                  if(j==lol)
                  {
                    v[j].clear();
                  }

                  repit(v[j])
                  {
                    if(*itx==lol)
                    {
                      v[j].erase(itx);
                      break;
                    }
                  }

                }
              }
              t_leaf.clear();
              for(int i=1;i<=n;i++)
              {
                if(v[i].size()==1)
                {
                  t_leaf.pb(i);leaf.pb(i);
                }
              }
              t_leaf.pb(ans);
              leaf.pb(ans);
            }
            else
            {
              leaf.clear();
              for(int i=0;i<t_leaf.size();i++)
              {
                int lol=t_leaf[i];
                for(int j=1;j<=n;j++)
                {
                  if(j==lol)
                  {
                    v[j].clear();
                  }

                  repit(v[j])
                  {
                    if(*itx==lol)
                    {
                      v[j].erase(itx);
                      break;
                    }
                  }

                }
              }
              t_leaf.clear();
              for(int i=1;i<=n;i++)
              {
                if(v[i].size()==1)
                {
                  t_leaf.pb(i);leaf.pb(i);
                }
              }
              if(leaf.size()==1)
              {
                leaf.pb(sta);
                t_leaf.pb(sta);
              }

            }
        }
    }
    cout<<"! "<<ans;el
}


#pragma GCC optimize("Ofast")

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

#define endl '\n'

int n; vector<set<int>> adj;
set<int> leafList;

int ask(int u, int v) {
	cout << "? " << u+1 << " " << v+1 << endl; cout.flush();
	int w; cin >> w; assert(w != -1);
	return (w - 1);
}

void answer(int r) {
	cout << "! " << (r+1) << endl;
	cout.flush(); exit(0);
}

void purge(int z, int last, int blockpoint) {
	if (leafList.find(z) != leafList.end()) leafList.erase(z);

	for (int t: adj[z]) {
		if (t == last) continue;
		if (t == blockpoint) adj[t].erase(z);
		else if (adj[t].size() != 0) purge(t, z, blockpoint);
	}

	adj[z].clear();
}

void Input() {
	cin >> n; adj.resize(n);
	for (int i=1; i<n; i++) {
		int x, y; cin >> x >> y; x--; y--;
		adj[x].insert(y); adj[y].insert(x);
	}
}

void Solve() {
	for (int i=0; i<n; i++) {
		if (adj[i].size() == 1) leafList.insert(i);
	}

	while (leafList.size() > 1) {
		int u = *leafList.begin(); leafList.erase(u);
		int v = *leafList.begin(); leafList.erase(v);
		int w = ask(u, v);
		if (w == u || w == v) answer(w);

		purge(u, -1, w); purge(v, -1, w);
		if (adj[w].size() <= 1) leafList.insert(w);
	}

	answer(*leafList.begin());
}

int main(int argc, char* argv[]) {
	ios_base::sync_with_stdio(false);
	Input(); Solve(); return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define mai3(a,b,c) mai(a,mai(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m)  for(itx=m.begin();itx!=m.end();itx++)
#define ins insert
 #define INF 1000000000000000000
 #define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 int power(int a,int x)
 {
         a%=mod;
        int res=1;
    while(x>0)
        {
            if(x&1)
            res=res*a%mod;
            a=a*a%mod;
            x>>=1;
        }
    return res;
}
int mai(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
vector<int>v[1005];

int mark[10004];
int n;
void remo(int s)
{
  for(int i=1;i<=n;i++)
  {
    if(i==s)
    {
      v[s].clear();
    }
    else
    {
      std::vector<int> ::iterator itx;
      for(itx=v[i].begin();itx!=v[i].end();itx++)
      {
        if(*itx==s)
        {
          v[i].erase(itx);break;
        }
      }

    }

  }

}

signed main()
{
    // std::vector<int> ::iterator itx;
    cin>>n;
    for(int i=1;i<n;i++)
    {
        int x,y;cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    // vector<int>leaf;
    vector<int>t_leaf;
    vector<int>leaf;
    int sta;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()==1)
        {
          sta=i;
            t_leaf.pb(i);
            leaf.pb(i);
        }
    }

    int ans=1;
    int x=n/2;
    vector<int>xx;

    // el
    while(x--)
    {
        if(leaf.size()>=2)
        {
            vector<int>::iterator  it=leaf.begin();
            int x1=*it;
            it++;
            int x2=*it;

            cout<<"? "<<x1<<" "<<x2;el
            int z;cin>>z;
            ans=z;
                if(x1==z||x2==z)
                {
                    ans=z;
                    break;
                }

                 remo(x1);remo(x2);
                  if(v[ans].size()<=1)
                 {
                    leaf.pb(ans);
                 }
                leaf.erase(leaf.begin());
                leaf.erase(leaf.begin());
        }

        else
        {
          break;
        }

        }

    if(leaf.size()==1)
    {
      ans=leaf[0];
    }

    cout<<"! "<<ans;el
}


#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define mai3(a,b,c) mai(a,mai(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m) for(auto it=m.begin();it!=m.end();it++)
#define ins insert
 #define INF 1000000000000000000
 #define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 int power(int a,int x)
 {
         a%=mod;
        int res=1;
		while(x>0)
        {
            if(x&1)
            res=res*a%mod;
            a=a*a%mod;
            x>>=1;
        }
		return res;
}
int mai(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
vector<int>v[1005];
int visit[1005],level[1005];
void bfs(int s)
{
    visit[s]=1;
    level[s]=1;
    queue<int>q;
    q.push(s);
    while(!q.empty())
    {
        int p=q.front();
        q.pop();
        for(int i=0;i<v[p].size();i++)
        {
            if(visit[v[p][i]]==0)
            {
                visit[v[p][i]]=1;
                level[v[p][i]]=level[p]+1;
            }
        }
    }
}
signed main()
{
    int n;cin>>n;
    for(int i=1;i<n;i++)
    {
        int x,y;cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    bfs(1);
    vector<int>leaf;
    for(int i=2;i<=n;i++)
    {
        if(v[i].size()==1)
        {
            leaf.pb(i);
        }
    }
    sort(all(leaf));
    int ans=1;
    int x=n/2;
    while(x--)
    {
        cout<<"? 1 "<<leaf[leaf.size()-1];el
        leaf.pop_back();
        int z;cin>>z;
        if(z!=1)
        {
            ans=z;
            break;
        }
    }
    cout<<"! "<<ans;el
}


#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define mai3(a,b,c) mai(a,mai(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m) for(auto it=m.begin();it!=m.end();it++)
#define ins insert
 #define INF 1000000000000000000
 #define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 int power(int a,int x)
 {
         a%=mod;
        int res=1;
		while(x>0)
        {
            if(x&1)
            res=res*a%mod;
            a=a*a%mod;
            x>>=1;
        }
		return res;
}
int mai(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
vector<int>v[1005];
int visit[1005],level[1005];
void bfs(int s)
{
    visit[s]=1;
    level[s]=1;
    queue<int>q;
    q.push(s);
    while(!q.empty())
    {
        int p=q.front();
        q.pop();
        for(int i=0;i<v[p].size();i++)
        {
            if(visit[v[p][i]]==0)
            {
                visit[v[p][i]]=1;
                level[v[p][i]]=level[p]+1;
            }
        }
    }
}
int mark[10004];
signed main()
{
    int n;cin>>n;
    for(int i=1;i<n;i++)
    {
        int x,y;cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    bfs(1);
    // vector<int>leaf;
    vector<int>leaf;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()==1)
            leaf.pb(i);
    }

    int ans=1;
    int x=n/2;
    vector<int>xx;

    // el
    while(x--)
    {
        if(leaf.size()>=2)
        {
            auto it=leaf.begin();
            int x1=*it;
            it++;
            int x2=*it;

            cout<<"? "<<x1<<" "<<x2;el
            int z;cin>>z;
            ans=z;
                if(x1==z||x2==z)
                {
                    ans=z;
                    break;
                }
                auto itx=leaf.begin();
                leaf.erase(leaf.begin());
                leaf.erase(itx);
                int flag=0;
                for(int j=0;j<leaf.size();j++)
                {
                    if(leaf[j]==z)
                    {
                        flag=1;
                        break;
                    }
                }
                if(flag==0)
                {
                    leaf.pb(z);
                }
        }
        else
        {
            if(leaf.size()==1)
            {
                auto it=leaf.begin();
               ans=*it;
            }
            leaf.clear();
            break;
        }
    }

    cout<<"! "<<ans;el
}


#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define mai3(a,b,c) mai(a,mai(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m) for(auto it=m.begin();it!=m.end();it++)
#define ins insert
 #define INF 1000000000000000000
 #define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 int power(int a,int x)
 {
         a%=mod;
        int res=1;
		while(x>0)
        {
            if(x&1)
            res=res*a%mod;
            a=a*a%mod;
            x>>=1;
        }
		return res;
}
int mai(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
vector<int>v[1005];
int visit[1005],level[1005];
void bfs(int s)
{
    visit[s]=1;
    level[s]=1;
    queue<int>q;
    q.push(s);
    while(!q.empty())
    {
        int p=q.front();
        q.pop();
        for(int i=0;i<v[p].size();i++)
        {
            if(visit[v[p][i]]==0)
            {
                visit[v[p][i]]=1;
                level[v[p][i]]=level[p]+1;
            }
        }
    }
}
int mark[10004];
signed main()
{
    int n;cin>>n;
    for(int i=1;i<n;i++)
    {
        int x,y;cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    bfs(1);
    // vector<int>leaf;
    vector<int>leaf;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()==1)
            leaf.pb(i);
    }

    int ans=1;
    int x=n/2;
    vector<int>xx;

    // el
    while(x--)
    {
        // repit(leaf)
        // {
        //     cout<<*it<<" ";
        // }
        // el
        if(leaf.size()>=2)
        {
            auto it=leaf.begin();
            int x1=*it;
            it++;
            int x2=*it;

            cout<<"? "<<x1<<" "<<x2;el
            int z;cin>>z;
            ans=z;

                auto itx=leaf.begin();
                leaf.erase(leaf.begin());
                leaf.erase(itx);
                int flag=0;
                for(int j=0;j<leaf.size();j++)
                {
                    if(leaf[j]==z)
                    {
                        flag=1;
                        break;
                    }
                }
                if(flag==0)
                {
                    leaf.pb(z);
                }
        }
        else
        {
            if(leaf.size()==1)
            {
                auto it=leaf.begin();
               ans=*it;
            }
            leaf.clear();
        }
    }

    cout<<"! "<<ans;el
}


#include <bits/stdc++.h>
using namespace std;
#define int  long long int
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define gcd __gcd
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define min3(a,b,c) min(a,min(b,c))
#define mai3(a,b,c) mai(a,mai(b,c))
#define all(i) i.begin(),i.end()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define set_bit __builtin_popcount //gives number of set_bits
#define ff first
#define ss second
#define cases(t) int t;cin>>t; rep(casn,1,t+1)
#define el cout<<"\n";
#define deci(n) int n; scanf("%lld",&n);
#define decs(n) string n; cin>>n;
#define sz(v) v.size()
#define repit(m)  for(itx=m.begin();itx!=m.end();itx++)
#define ins insert
 #define INF 1000000000000000000
 #define NP 50000

//  cerr << "\nTime : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";

//  IIITA
//SUNEET KUMAR -->  ਸੁਨੀਤ
 int power(int a,int x)
 {
         a%=mod;
        int res=1;
    while(x>0)
        {
            if(x&1)
            res=res*a%mod;
            a=a*a%mod;
            x>>=1;
        }
    return res;
}
int mai(int a,int b)
{
    if(a>b)
    {
        return a;
    }
    else
    {
        return b;
    }
}
int madd(int a,int b)
{
    int ans;
    ans=(a%mod+b%mod)%mod;
    return ans;
}
int mmult(int a,int b)
{
    int ans=1;
    ans=((a%mod)*(b%mod))%mod;
    return ans%mod;
}
int modinverse(int a)
{
    return power(a,mod-2);
}
vector<int>v[1005];
int visit[1005],level[1005];
void bfs(int s)
{
    visit[s]=1;
    level[s]=1;
    queue<int>q;
    q.push(s);
    while(!q.empty())
    {
        int p=q.front();
        q.pop();
        for(int i=0;i<v[p].size();i++)
        {
            if(visit[v[p][i]]==0)
            {
                visit[v[p][i]]=1;
                level[v[p][i]]=level[p]+1;
            }
        }
    }
}
int mark[10004];
signed main()
{
    std::vector<int> ::iterator itx;
    int n;cin>>n;
    for(int i=1;i<n;i++)
    {
        int x,y;cin>>x>>y;
        v[x].pb(y);
        v[y].pb(x);
    }
    bfs(1);
    // vector<int>leaf;
    vector<int>t_leaf;
    vector<int>leaf;
    for(int i=1;i<=n;i++)
    {
        if(v[i].size()==1)
        {
            t_leaf.pb(i);
            leaf.pb(i);
        }
    }

    int ans=1;
    int x=n/2;
    vector<int>xx;

    // el
    while(x--)
    {
        if(leaf.size()>=2)
        {
            vector<int>::iterator  it=leaf.begin();
            int x1=*it;
            it++;
            int x2=*it;

            cout<<"? "<<x1<<" "<<x2;el
            int z;cin>>z;
            ans=z;
                if(x1==z||x2==z)
                {
                    ans=z;
                    break;
                }

                leaf.erase(leaf.begin());
                leaf.erase(leaf.begin());

        }
        else
        {
            if(leaf.size()==1)
            {
              vector<int>::iterator  it=leaf.begin();
               ans=*it;
               leaf.clear();
              for(int i=0;i<t_leaf.size();i++)
              {
                int lol=t_leaf[i];
                for(int j=1;j<=n;j++)
                {
                  if(j==lol)
                  {
                    v[j].clear();
                  }

                  repit(v[j])
                  {
                    if(*itx==lol)
                    {
                      v[j].erase(itx);
                      break;
                    }
                  }

                }
              }
              t_leaf.clear();
              for(int i=1;i<=n;i++)
              {
                if(v[i].size()==1)
                {
                  t_leaf.pb(i);leaf.pb(i);
                }
              }
              t_leaf.pb(ans);
              leaf.pb(ans);
            }
            else
            {
              leaf.clear();
              for(int i=0;i<t_leaf.size();i++)
              {
                int lol=t_leaf[i];
                for(int j=1;j<=n;j++)
                {
                  if(j==lol)
                  {
                    v[j].clear();
                  }

                  repit(v[j])
                  {
                    if(*itx==lol)
                    {
                      v[j].erase(itx);
                      break;
                    }
                  }

                }
              }
              t_leaf.clear();
              for(int i=1;i<=n;i++)
              {
                if(v[i].size()==1)
                {
                  t_leaf.pb(i);leaf.pb(i);
                }
              }

            }
        }
    }
    cout<<"! "<<ans;el
}