#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
int n, siz, rt, flag, sz[N], mp[N], a[N];
vector<int> G[N], vec[2];
void dfs(int u, int fa) {
  sz[u] = 1;
  int mx = 0;
  for (int i = 0; i < G[u].size(); i++)
    if (G[u][i] != fa)
      dfs(G[u][i], u), sz[u] += sz[G[u][i]], mx = max(mx, sz[G[u][i]]);
  mx = max(mx, n - sz[u]);
  if (mx < siz) siz = mx, rt = u;
}
void dfs1(int u, int fa, int dep) {
  if (!a[dep])
    a[dep] = G[u].size();
  else if (a[dep] != G[u].size())
    flag = 1;
  sz[u] = 1;
  for (int i = 0; i < G[u].size(); i++)
    if (G[u][i] != fa) dfs1(G[u][i], u, dep + 1), sz[u] += sz[G[u][i]];
  if (G[u].size() == 1) mp[dep] = u;
}
bool solve() {
  flag = 0;
  memset(a, 0, sizeof a);
  for (int i = 0; i < G[rt].size(); i++) dfs1(G[rt][i], rt, 1);
  if (flag) return 0;
  for (int i = 1; i < G[rt].size(); i++)
    if (sz[G[rt][i]] != sz[G[rt][0]]) return 0;
  return 1;
}
int main() {
  scanf("%d", &n);
  if (n <= 3) {
    puts("1");
    return 0;
  }
  siz = n;
  for (int i = 1, x, y; i < n; i++)
    scanf("%d%d", &x, &y), G[x].push_back(y), G[y].push_back(x);
  dfs(1, 0);
  if (solve()) {
    printf("%d", rt);
    return 0;
  }
  for (int i = 0; i < n; i++)
    if (mp[i]) {
      rt = mp[i];
      if (solve()) {
        printf("%d", rt);
        return 0;
      }
    }
  puts("-1");
}
