#include <bits/stdc++.h>
using namespace std;
const int N = 100005, inf = 0x3f3f3f3f;
int n, tot, rt, mi, krt, root, rt2, len_rt2;
int head[N], Next[N << 1], ver[N << 1], deg[N], size[N], dep[N], son[N];
vector<int> v[N];
inline void add(int x, int y) {
  ver[++tot] = y;
  Next[tot] = head[x];
  head[x] = tot;
  deg[y]++;
}
inline void getroot(int x, int fa) {
  size[x] = 1;
  for (int i = head[x]; i; i = Next[i]) {
    int y = ver[i];
    if (y == fa) continue;
    getroot(y, x);
    size[x] += size[y];
    son[x] = max(son[x], size[y]);
  }
  son[x] = max(son[x], n - size[x]);
  if (son[x] < son[root]) root = x;
}
inline void dfs(int x, int fa) {
  dep[x] = dep[fa] + 1;
  for (int i = head[x]; i; i = Next[i]) {
    int y = ver[i];
    if (y == fa) continue;
    dfs(y, x);
  }
}
inline void solve(int root) {
  dfs(root, 0);
  for (int i = 0; i <= n; i++) v[i].clear();
  for (int i = 1; i <= n; i++) v[dep[i]].push_back(i);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < v[i].size(); j++)
      if (deg[v[i][0]] != deg[v[i][j]]) return;
  printf("%d\n", root);
  exit(0);
}
inline int check(int x, int fa) {
  if (deg[x] > 2) return 0;
  if (deg[x] == 1) {
    krt = x;
    return 1;
  }
  for (int i = head[x]; i; i = Next[i]) {
    int y = ver[i];
    if (y == fa) continue;
    int res = check(y, x);
    if (!res)
      return 0;
    else
      return res + 1;
  }
}
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    add(x, y);
    add(y, x);
  }
  son[0] = n;
  getroot(1, 0);
  solve(root);
  for (register int i = head[root]; i; i = Next[i]) {
    int len = check(ver[i], root);
    if (!len) continue;
    if (rt2 && len != len_rt2) {
      solve(krt);
      break;
    }
    if (!rt2) rt2 = krt, len_rt2 = len, solve(krt);
  }
  puts("-1");
  return 0;
}
