#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const long long N = 100100;
vector<long long> g[N];
long long pai[N];
long long L[N];
void dfs(long long v, long long p = -1) {
  for (long long to : g[v]) {
    if (to == p) continue;
    pai[to] = v;
    L[to] = L[v] + 1;
    dfs(to, v);
  }
}
long long n;
long long acha(long long v) {
  queue<long long> q;
  vector<long long> dist(n + 1, -1);
  q.push(v);
  dist[v] = 0;
  while (!q.empty()) {
    long long cur = q.front();
    q.pop();
    for (long long to : g[cur]) {
      if (dist[to] != -1) continue;
      if ((long long)g[to].size() == 2 or (long long) g[to].size() == 1) {
        q.push(to);
        dist[to] = dist[cur] + 1;
      }
    }
  }
  long long id = v;
  long long big = 1e9;
  for (long long i = 1; i <= n; i++) {
    if ((long long)g[i].size() == 1 and dist[i] != -1 and big > dist[i]) {
      big = dist[i];
      id = i;
    }
  }
  return id;
}
vector<long long> center() {
  vector<long long> prev;
  long long u = 1;
  for (long long it = 0; it < 2; it++) {
    prev.resize(n + 1);
    for (long long i = 1; i <= n; i++) prev[i] = -1;
    queue<long long> q;
    q.push(prev[u] = u);
    while (!q.empty()) {
      u = q.front();
      q.pop();
      for (long long i = 0; i < (long long)g[u].size(); i++) {
        long long to = g[u][i];
        if (prev[to] >= 0) continue;
        prev[to] = u;
        q.push(to);
      }
    }
  }
  vector<long long> path;
  path.push_back(u);
  while (u != prev[u]) {
    path.push_back(u = prev[u]);
  }
  long long m = path.size();
  vector<long long> res;
  if (m % 2 == 1) {
    res.push_back(path[m / 2]);
    long long a = acha(path[m / 2]);
    if (a != path[m / 2]) res.push_back(a);
  } else {
    res.push_back(path[m / 2]);
    res.push_back(path[m / 2 - 1]);
    long long a = acha(path[m / 2]);
    if (a != path[m / 2]) res.push_back(a);
    a = acha(path[m / 2 - 1]);
    if (a != path[m / 2 - 1]) res.push_back(a);
  }
  res.push_back(path[0]);
  res.push_back(path[m - 1]);
  return res;
}
vector<long long> inL[N];
void dfs2(long long v, long long p = -1) {
  inL[L[v]].push_back(v);
  for (long long to : g[v]) {
    if (to == p) continue;
    L[to] = L[v] + 1;
    dfs2(to, v);
  }
}
long long ok(long long v) {
  for (long long i = 0; i <= n; i++) inL[i].clear();
  L[v] = 0;
  dfs2(v, -1);
  for (long long i = 1; i <= n; i++) {
    if (inL[i].size() == 0) break;
    long long ini = g[inL[i][0]].size();
    for (long long x : inL[i])
      if (g[x].size() != ini) return false;
  }
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  if (n == 1) {
    cout << 1 << "\n";
    return 0;
  }
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1);
  vector<long long> vec = center();
  for (long long x : vec) {
    if (ok(x)) {
      cout << x << "\n";
      return 0;
    }
  }
  cout << -1 << "\n";
  return 0;
}
