#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long INF = mod * mod;
const long double eps = 1e-4;
const long double pi = acos(-1.0);
int n;
vector<int> G[1 << 17];
vector<int> depth;
void dfs(int id, int fr, int k) {
  depth[id] = k;
  for (int j = 0; j < G[id].size(); j++) {
    int to = G[id][j];
    if (to == fr) continue;
    dfs(to, id, k + 1);
  }
}
int par[1 << 17];
void solve() {
  cin >> n;
  fill(par, par + n, -1);
  vector<int> cntfr(n, 0);
  depth.resize(n, 0);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  queue<int> q;
  vector<bool> used(n, false);
  for (int i = 0; i < n; i++) {
    if (G[i].size() == 1) q.push(i), used[i] = true;
  }
  if (q.size() == 2) {
    cout << q.front() + 1 << endl;
    return;
  }
  int root = 0;
  while (!q.empty()) {
    int len = q.size();
    vector<int> rnex;
    vector<pair<int, int> > nex, nex2;
    for (int aa = 0; aa < len; aa++) {
      int id = q.front();
      q.pop();
      root = id;
      for (int j = 0; j < G[id].size(); j++) {
        int to = G[id][j];
        cntfr[to]++;
        if (!used[to]) {
          used[to] = true;
          q.push(to);
          par[to] = id;
          rnex.push_back(to);
        }
      }
    }
    for (int j = 0; j < rnex.size(); j++) {
      nex.push_back({cntfr[rnex[j]], rnex[j]});
      nex2.push_back({G[rnex[j]].size(), rnex[j]});
    }
    sort(nex.begin(), nex.end());
    sort(nex2.begin(), nex2.end());
    for (int j = 0; j < (int)nex.size() - 1; j++) {
      if (nex[j].first != nex[j + 1].first) {
        if (j > 0) {
          root = nex[j + 1].second;
        } else {
          root = nex[j].second;
        }
        while (par[root] >= 0) root = par[root];
        while (!q.empty()) q.pop();
        break;
      }
    }
    if (q.empty()) break;
    for (int j = 0; j < (int)nex2.size() - 1; j++) {
      if (nex2[j].first != nex2[j + 1].first) {
        if (j > 0) {
          root = nex2[j + 1].second;
        } else {
          root = nex2[j].second;
        }
        while (par[root] >= 0) root = par[root];
        while (!q.empty()) q.pop();
        break;
      }
    }
  }
  dfs(root, -1, 0);
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    v.push_back({depth[i], i});
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < n - 1; i++) {
    if (v[i].first == v[i + 1].first) {
      if (G[v[i].second].size() != G[v[i + 1].second].size()) {
        cout << -1 << endl;
        return;
      }
    }
  }
  cout << root + 1 << endl;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  solve();
  return 0;
}
