#include <bits/stdc++.h>
using namespace std;
const int N = 102000 * 2;
int first[N], nxt[N], point[N], e = 0, n, in[N];
void add_edge(int x, int y) {
  nxt[e] = first[x];
  first[x] = e;
  point[e++] = y;
}
int pre[N], dep[N], root, to;
int jud[N];
void dfs(int u, int f, int T) {
  if (u == -1) return;
  for (int i = first[u]; i != -1; i = nxt[i]) {
    int v = point[i];
    if (v == f) continue;
    dep[v] = dep[u] + 1;
    if (T) pre[v] = u;
    dfs(v, u, T);
  }
}
void judge(int R) {
  if (R == -1) return;
  int bl = 1;
  memset(jud, -1, sizeof(jud));
  for (int i = 1; i <= n; i++) {
    if (jud[dep[i]] == -1)
      jud[dep[i]] = in[i];
    else if (jud[dep[i]] != in[i])
      bl = 0;
  }
  if (bl) {
    printf("%d\n", R);
    exit(0);
  }
}
int vis[N];
int bfs(int from) {
  queue<int> q;
  q.push(from);
  vis[from] = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int i = first[u]; i != -1; i = nxt[i]) {
      int v = point[i];
      if (vis[v] || in[v] > 2) continue;
      if (in[v] == 1) return v;
      q.push(v);
      vis[v] = 1;
    }
  }
  return -1;
}
int main() {
  memset(first, -1, sizeof(first));
  memset(nxt, -1, sizeof(nxt));
  memset(pre, -1, sizeof(pre));
  scanf("%d", &n);
  if (n == 1) {
    puts("1");
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    in[x]++;
    in[y]++;
    add_edge(x, y);
    add_edge(y, x);
  }
  dep[1] = 0;
  dfs(1, -1, 0);
  int maxdep = 0;
  for (int i = 1; i <= n; i++) {
    if (maxdep < dep[i]) root = i, maxdep = dep[i];
  }
  dep[root] = 0;
  dfs(root, -1, 1);
  maxdep = 0;
  for (int i = 1; i <= n; i++) {
    if (maxdep < dep[i]) to = i, maxdep = dep[i];
  }
  judge(root);
  dep[to] = 0;
  dfs(to, -1, 0);
  judge(to);
  int mid = maxdep / 2, now = to, d = maxdep;
  while (now != -1) {
    now = pre[now];
    d--;
    if (d == mid) break;
  }
  dfs(now, -1, 0);
  judge(now);
  int top = bfs(now);
  dfs(top, -1, 0);
  judge(top);
  puts("-1");
  return 0;
}
