#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &x) {
  x = 0;
  int fu = 1;
  char c = getchar();
  while (c > 57 || c < 48) {
    if (c == 45) fu = -1;
    c = getchar();
  }
  while (c <= 57 && c >= 48) {
    x = (x << 3) + (x << 1) + c - 48;
    c = getchar();
  }
  x *= fu;
}
template <typename T>
inline void fprint(T x) {
  if (x < 0) {
    putchar(45);
    x = -x;
  }
  if (x > 9) fprint(x / 10);
  putchar(x % 10 + 48);
}
int dep[100010], sz[100010], d[100010];
int rt;
int n;
int head[100010], nxt[100010 << 1], e[100010 << 1], cnt;
int ans = 0x3f3f3f3f;
void get_rt(int x, int pre) {
  int mx = -1;
  sz[x] = 1;
  for (register int i = head[x]; i; i = nxt[i]) {
    if (e[i] == pre) continue;
    get_rt(e[i], x);
    sz[x] = sz[x] + sz[e[i]];
    mx = max(mx, sz[e[i]]);
  }
  mx = max(mx, n - sz[x]);
  if (mx < ans) {
    ans = mx;
    rt = x;
  }
}
void dfs(int x, int pre) {
  dep[x] = dep[pre] + 1;
  for (register int i = head[x]; i; i = nxt[i]) {
    if (e[i] == pre) continue;
    dfs(e[i], x);
  }
}
vector<int> ck[100010];
void check(int x) {
  dfs(x, 0);
  for (register int i = 1; i <= n; i++) ck[i].clear();
  for (register int i = 1; i <= n; i++) ck[dep[i]].push_back(i);
  for (register int i = 1; i <= n; i++) {
    for (register int j = 1; j < ck[i].size(); j++) {
      if (d[ck[i][j]] != d[ck[i][0]]) return;
    }
  }
  fprint(x);
  exit(0);
}
void add(int u, int v) {
  nxt[++cnt] = head[u];
  head[u] = cnt;
  e[cnt] = v;
}
int RT;
bool find_rt;
int find_len;
int line(int x, int pre) {
  if (d[x] > 2) return 0;
  if (d[x] == 1) {
    RT = x;
    return 1;
  }
  for (register int i = head[x]; i; i = nxt[i]) {
    if (e[i] == pre) continue;
    int ret = line(e[i], x);
    if (!ret) return 0;
    return ret + 1;
  }
}
int main() {
  read(n);
  for (register int i = 1; i < n; i++) {
    int u, v;
    read(u);
    read(v);
    add(u, v);
    add(v, u);
    d[u]++;
    d[v]++;
  }
  get_rt(1, 0);
  check(rt);
  for (register int i = head[rt]; i; i = nxt[i]) {
    int tmp = line(e[i], rt);
    if (tmp == 0) continue;
    if (find_rt) {
      if (tmp != find_len) {
        check(RT);
        break;
      }
    } else {
      check(RT);
      find_rt = true;
      find_len = tmp;
    }
  }
  fprint(-1);
  return 0;
}
