#include <bits/stdc++.h>
using namespace std;
using cd = complex<double>;
map<pair<long long, pair<long long, long long> >, long long> p[100005];
set<long long> s[200005][2];
long long c[200005], sz[200005], d[200005], mx[200005], n;
vector<long long> edge[200005];
void dfs(long long u, long long fa) {
  sz[u] = 1;
  c[u] = 1;
  for (auto v : edge[u]) {
    if (v == fa) continue;
    dfs(v, u);
    sz[u] += sz[v];
    c[u] &= c[v];
    s[u][c[v]].insert(v);
    p[u][{mx[v], {d[v], sz[v]}}]++;
  }
  if (p[u].size() > 1) c[u] = 0;
  if (p[u].size() == 0)
    mx[u] = 0;
  else
    mx[u] = p[u].rbegin()->first.first + 1;
}
void solve(long long u, long long fa) {
  if (fa == 0) {
    if (c[u]) {
      cout << u << endl;
      exit(0);
    }
    for (auto v : edge[u]) {
      if (v == fa) continue;
      solve(v, u);
    }
    return;
  }
  long long sf = sz[fa], su = sz[u];
  long long cf = c[fa], cu = c[u];
  long long mf = mx[fa], mu = mx[u];
  sz[fa] -= sz[u];
  sz[u] = n;
  s[fa][cu].erase(u);
  p[fa][{mu, {d[u], su}}]--;
  if (p[fa][{mu, {d[u], su}}] == 0) p[fa].erase({mu, {d[u], su}});
  if (s[fa][0].size() == 0 && p[fa].size() <= 1)
    c[fa] = 1;
  else
    c[fa] = 0;
  if (p[fa].size())
    mx[fa] = p[fa].rbegin()->first.first + 1;
  else
    mx[fa] = 0;
  s[u][c[fa]].insert(fa);
  p[u][{mx[fa], {d[fa], sz[fa]}}]++;
  if (s[u][0].size() == 0 && p[u].size() <= 1)
    c[u] = 1;
  else
    c[u] = 0;
  mx[u] = p[u].rbegin()->first.first + 1;
  if (c[u]) {
    cout << u << endl;
    exit(0);
  }
  for (auto v : edge[u]) {
    if (v == fa) continue;
    solve(v, u);
  }
  s[fa][cu].insert(u);
  p[fa][{mu, {d[u], su}}]++;
  s[u][c[fa]].erase(fa);
  p[u][{mx[fa], {d[fa], sz[fa]}}]--;
  if (p[u][{mx[fa], {d[fa], sz[fa]}}] == 0)
    p[u].erase({mx[fa], {d[fa], sz[fa]}});
  sz[fa] = sf;
  sz[u] = su;
  c[fa] = cf;
  c[u] = cu;
  mx[fa] = mf;
  mx[u] = mu;
}
int main() {
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    edge[u].push_back(v);
    edge[v].push_back(u);
    d[u]++;
    d[v]++;
  }
  dfs(1, 0);
  solve(1, 0);
  cout << -1 << endl;
}
