#include <bits/stdc++.h>
using namespace std;
const int INF = (1ll << 31) - 1;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 5;
int n, u, v, num;
int cnt;
vector<int> G[maxn];
map<int, int> m[maxn];
int p[maxn];
long long f[maxn], g[maxn];
bool cmp(int a, int b) { return f[a] < f[b]; }
void dfs1(int rt, int fa) {
  f[rt] = p[G[rt].size()];
  for (auto i : G[rt]) {
    if (i == fa) continue;
    dfs1(i, rt);
    f[rt] = (f[rt] + f[i]) % mod;
    m[rt][f[i]]++;
  }
  f[rt] = f[rt] * p[G[rt].size()] % mod;
  if (m[rt].size() > 1) cnt++;
}
void remove(int a, int num) {
  if (m[a].size() > 1) cnt--;
  m[a][num]--;
  if (m[a][num] == 0) m[a].erase(num);
  if (m[a].size() > 1) cnt++;
}
void add(int a, int num) {
  if (m[a].size() < 2) cnt++;
  m[a][num]++;
  if (m[a].size() < 2) cnt--;
}
void move(int a, int b) {
  f[a] = (f[a] - f[b] * p[G[a].size()] % mod) % mod + mod;
  f[a] %= mod;
  remove(a, f[b]);
  add(b, f[a]);
  f[b] = (f[b] + f[a] * p[G[b].size()] % mod) % mod + mod;
  f[b] %= mod;
}
bool flag = false;
void dfs2(int rt, int fa) {
  if (cnt == 0) {
    cout << rt;
    flag = true;
    return;
  }
  for (auto i : G[rt]) {
    if (i == fa) continue;
    move(rt, i);
    dfs2(i, rt);
    if (flag) return;
    move(i, rt);
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) p[i] = 1.0 * rand() / RAND_MAX * INF;
  dfs1(1, 0);
  memcpy(g, f, sizeof(g));
  dfs2(1, 0);
  if (!flag) cout << -1;
}
