#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 7;
int vis1[MAXN], vis2[MAXN], dis[MAXN], vis3[MAXN], dis1[MAXN];
int st, ed, n, ans;
queue<int> q;
vector<int> G[MAXN];
void Bfs1() {
  for (; !q.empty();) q.pop();
  q.push(1);
  vis1[1] = 1;
  for (; !q.empty();) {
    int u = q.front();
    q.pop();
    for (auto v : G[u]) {
      if (vis1[v]) continue;
      q.push(v);
      vis1[v] = u;
    }
    st = u;
  }
}
void Bfs2() {
  for (; !q.empty();) q.pop();
  q.push(st);
  vis2[st] = st;
  for (; !q.empty();) {
    int u = q.front();
    q.pop();
    for (auto v : G[u]) {
      if (vis2[v]) continue;
      q.push(v);
      vis2[v] = u;
    }
    ed = u;
  }
}
int degree(int x) { return (int)G[x].size(); }
bool check(int root) {
  for (int i = 1; i <= n; i++) vis1[i] = dis[i] = 0;
  for (; !q.empty();) q.pop();
  q.push(root);
  vis1[root] = 1;
  for (; !q.empty();) {
    int u = q.front();
    q.pop();
    for (auto v : G[u]) {
      if (vis1[v]) continue;
      q.push(v);
      vis1[v] = vis1[u] + 1;
      if (!dis[vis1[v]]) dis[vis1[v]] = v;
      if (degree(v) != degree(dis[vis1[v]])) return false;
    }
  }
  ans = root;
  return true;
}
bool checkCenter() {
  int D = 0;
  for (int u = ed; u != st; u = vis2[u]) D++;
  if (D & 1) return false;
  int center = ed;
  for (int i = 0; i != D / 2; i++, center = vis2[center])
    ;
  for (int i = 1; i <= n; i++) vis3[i] = dis1[i] = 0;
  for (; !q.empty();) q.pop();
  q.push(center);
  vis3[center] = 1;
  for (; !q.empty();) {
    int u = q.front();
    q.pop();
    for (auto v : G[u]) {
      if (vis3[v]) continue;
      q.push(v);
      vis3[v] = vis3[u] + 1;
      if (!dis1[vis3[v]]) dis1[vis3[v]] = v;
      if (degree(v) != degree(dis1[vis3[v]])) {
        for (int x = v, tim = 0;;) {
          if (++tim == n) break;
          if (G[x].size() == 1) {
            if (check(x))
              return true;
            else
              break;
          } else
            x = (vis3[G[x][0]] == 0) ? G[x][0] : G[x][1];
        }
        for (int x = dis1[vis3[v]], tim = 0;;) {
          if (++tim == n) break;
          if (G[x].size() == 1) {
            if (check(x))
              return true;
            else
              break;
          } else
            x = (vis3[G[x][0]] == 0) ? G[x][0] : G[x][1];
        }
        return false;
      }
    }
  }
  ans = center;
  return true;
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  Bfs1();
  Bfs2();
  if (check(st) || check(ed))
    cout << ans;
  else if (checkCenter())
    cout << ans;
  else
    cout << -1;
}
