#include <bits/stdc++.h>
using namespace std;
int n, S, sl, fh, num, q[100010], d[100010], dd[100010], vis[100010],
    dis[100010], pre[100010];
int t, h[100010];
struct Tre {
  int to, nxt;
} e[100010 << 1];
queue<int> Q;
int rd() {
  sl = 0;
  fh = 1;
  char ch = getchar();
  while (ch < '0' || '9' < ch) {
    if (ch == '-') fh = -1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') sl = sl * 10 + ch - '0', ch = getchar();
  return sl * fh;
}
void add(int u, int v) {
  e[++t] = (Tre){v, h[u]};
  h[u] = t;
  e[++t] = (Tre){u, h[v]};
  h[v] = t;
  d[u]++;
  d[v]++;
}
void bfs() {
  memset(dis, 0, sizeof dis);
  memset(vis, 0, sizeof vis);
  memset(pre, 0, sizeof pre);
  Q.push(S);
  int u, v;
  dis[S] = vis[S] = 1;
  while (!Q.empty()) {
    u = Q.front();
    Q.pop();
    if (dis[u] > dis[S]) S = u;
    for (int i = h[u]; i; i = e[i].nxt)
      if ((v = e[i].to) != pre[u] && dis[u] + 1 >= dis[v]) {
        dis[v] = dis[u] + 1;
        pre[v] = u;
        if (!vis[v]) Q.push(v), vis[v] = 1;
      }
  }
}
bool dfs(int u, int f, int dep) {
  if (!dd[dep])
    dd[dep] = d[u];
  else if (d[u] != dd[dep])
    return 0;
  int v, flg;
  for (int i = h[u]; i; i = e[i].nxt)
    if ((v = e[i].to) != f) {
      flg = dfs(v, u, dep + 1);
      if (!flg) return 0;
    }
  return 1;
}
bool check(int x) {
  memset(dd, 0, sizeof dd);
  return dfs(x, 0, 1);
}
void dfs(int u, int f) {
  if (d[u] == 1) q[++num] = u;
  int v;
  for (int i = h[u]; i; i = e[i].nxt)
    if ((v = e[i].to) != f) dis[v] = dis[u] + 1, dfs(v, u);
}
bool cmp(int x, int y) { return dis[x] < dis[y]; }
int main() {
  n = rd();
  int x, y;
  S = 1;
  for (int i = 1; i < n; ++i) x = rd(), y = rd(), add(x, y);
  bfs();
  bfs();
  for (int i = S; i; i = pre[i]) q[++num] = i;
  if (check(q[1])) {
    printf("%d\n", q[1]);
    exit(0);
  }
  if (check(q[num])) {
    printf("%d\n", q[num]);
    exit(0);
  }
  x = q[(num + 1) / 2];
  if (check(x)) {
    printf("%d\n", x);
    exit(0);
  }
  dis[x] = 1;
  num = 0;
  dfs(x, 0);
  sort(q + 1, q + num + 1, cmp);
  if (check(q[1])) {
    printf("%d\n", q[1]);
    exit(0);
  }
  if (check(q[num])) {
    printf("%d\n", q[num]);
    exit(0);
  }
  puts("-1");
  return 0;
}
