#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int MAXN = 100010;
int Node[MAXN << 1], Next[MAXN << 1], Root[MAXN], Deg[MAXN];
int cnte;
int sz[MAXN], mx[MAXN], dep[MAXN];
int N, mxdep, rt;
vector<int> vd[MAXN];
inline void insert(int u, int v) {
  Node[++cnte] = v;
  Next[cnte] = Root[u];
  Root[u] = cnte;
}
inline void Findr(int k, int Fa) {
  sz[k] = 1;
  mx[k] = 0;
  for (int x = Root[k]; x; x = Next[x]) {
    int v = Node[x];
    if (v != Fa) {
      Findr(v, k);
      sz[k] += sz[v];
      mx[k] = max(mx[k], sz[v]);
    }
  }
  mx[k] = max(mx[k], N - sz[k]);
  if (!rt || mx[k] < mx[rt]) rt = k;
}
inline void dfs(int k, int Fa) {
  dep[k] = dep[Fa] + 1;
  vd[dep[k]].push_back(k);
  mxdep = max(mxdep, dep[k]);
  for (int x = Root[k]; x; x = Next[x]) {
    int v = Node[x];
    if (v != Fa) dfs(v, k);
  }
}
inline void check(int rt) {
  for (int i = 1; i <= N; i++) vd[i].clear();
  mxdep = 0;
  dfs(rt, 0);
  for (int i = 1; i <= mxdep; i++)
    for (int j = 1; j < vd[i].size(); j++)
      if (Deg[vd[i][j]] != Deg[vd[i][0]]) return;
  printf("%d\n", rt);
  exit(0);
}
int rtLine;
inline int isLine(int k, int Fa) {
  if (Deg[k] > 2) return 0;
  if (Deg[k] == 1) {
    rtLine = k;
    return 1;
  }
  for (int x = Root[k]; x; x = Next[x]) {
    int v = Node[x];
    if (v == Fa) continue;
    int vLine = isLine(v, k);
    if (!vLine)
      return 0;
    else
      return vLine + 1;
  }
}
int main() {
  N = read();
  for (int i = 1; i < N; i++) {
    int u = read(), v = read();
    insert(u, v);
    insert(v, u);
    ++Deg[u];
    ++Deg[v];
  }
  Findr(1, 0);
  check(rt);
  int lastLine = 0;
  for (int x = Root[rt]; x; x = Next[x]) {
    int v = Node[x], len = isLine(v, rt);
    if (!len) continue;
    if (!lastLine)
      check(rtLine), lastLine = len;
    else if (len != lastLine)
      check(rtLine);
  }
  puts("-1");
  return 0;
}
