#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool positive = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') positive = 0;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return positive ? x : -x;
}
inline void write(long long a) {
  if (a < 0) {
    a = -a;
    putchar('-');
  }
  if (a >= 10) write(a / 10);
  putchar('0' + a % 10);
}
inline void writeln(long long a) {
  write(a);
  puts("");
}
inline void wri(long long a) {
  write(a);
  putchar(' ');
}
long long rnd() {
  unsigned long long ans = 0;
  for (int i = (int)(0); i <= (int)(4); i++) ans = ans << 15 ^ rand();
  return ans % ((unsigned long long)1 << 63);
}
const int N = 100005;
int FA[N], dep[N], rt;
set<int> S[N];
vector<int> v[N];
void dfs(int p, int fa) {
  if (dep[p] > dep[rt]) {
    rt = p;
  }
  FA[p] = fa;
  S[dep[p]].insert(v[p].size());
  for (auto i : v[p])
    if (i != fa) {
      dep[i] = dep[p] + 1;
      dfs(i, p);
    }
}
void GG() {
  puts("-1");
  exit(0);
}
void ddd(int p, int fa) {
  if (fa && v[p].size() == 1 && dep[p] < dep[rt]) rt = p;
  if (fa && v[p].size() != 2) return;
  for (auto i : v[p])
    if (i != fa) {
      dep[i] = dep[p] + 1;
      ddd(i, p);
    }
}
int main() {
  int n = read();
  dep[0] = -1;
  for (int i = (int)(1); i <= (int)(n - 1); i++) {
    int s = read(), t = read();
    v[s].push_back(t);
    v[t].push_back(s);
  }
  rt = 0;
  dfs(1, 0);
  int t = rt;
  dep[t] = rt = 0;
  dfs(t, 0);
  for (int i = (int)(0); i <= (int)(n); i++) S[i].clear();
  for (int i = (int)((dep[rt] + 1) / 2); i >= (int)(1); i--) rt = FA[rt];
  t = rt;
  dep[t] = 0;
  dep[0] = 1e9;
  rt = 0;
  ddd(t, 0);
  if (rt) t = rt;
  dep[t] = 0;
  dfs(t, 0);
  for (int i = (int)(0); i <= (int)(n); i++)
    if (S[i].size() > 1) GG();
  cout << t << endl;
}
