#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
vector<int> g[110];
bool f1[110], f2[110];
void DFS(int u)
{
for (int v : g[u])
{
if (!f1[v])
{
f1[v] = f2[v] = true;
DFS(v);
f1[v] = false;
}
}
}
int main()
{
int n;
cin >> n;
for (int i = 1, x, y; i < n; i++)
{
cin >> x >> y;
g[y].push_back(x);
}
for (int i = 1; i <= n; i++)
{
memset(f1, false, sizeof f1);
memset(f2, false, sizeof f2);
DFS(i);
bool flag = true;
for (int j = 1; j <= n; j++)
{
if (!f2[j]) flag = false;
}
if (flag)
{
cout << i;
return 0;
}
}
cout << -1;
return 0;
}