#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> g[100010];
bool used[100010];
int d[100010];
int deg[100010];
void dfs(int x) {
  used[x] = 1;
  for (auto y : g[x]) {
    if (!used[y]) {
      d[y] = d[x] + 1;
      dfs(y);
    }
  }
}
int d1[100010];
void dfs1(int x) {
  used[x] = 1;
  for (auto y : g[x]) {
    if (!used[y]) {
      d1[y] = d1[x] + 1;
      dfs1(y);
    }
  }
}
bool check(int r) {
  fill(used, used + n, 0);
  d1[r] = 0;
  dfs1(r);
  vector<int> v[100010];
  for (int i = 0; i < n; i++) {
    v[d1[i]].push_back(i);
  }
  for (int i = 0; i < n; i++) {
    if (v[i].size() <= 1) continue;
    for (int j = 1; j < v[i].size(); j++) {
      if (deg[v[i][j - 1]] != deg[v[i][j]]) return false;
    }
  }
  return true;
}
int d2[100010];
void dfs2(int x) {
  used[x] = 1;
  for (auto y : g[x]) {
    if (!used[y]) {
      d2[y] = d2[x] + 1;
      dfs2(y);
    }
  }
}
bool dame;
int nuo;
int dist;
void dfs3(int x) {
  used[x] = 1;
  dist++;
  int cnt = 0;
  for (auto y : g[x]) {
    if (!used[y]) {
      dfs3(y);
      cnt++;
    }
  }
  if (cnt > 1)
    dame = 1;
  else if (cnt == 0)
    nuo = x;
}
int check_path(int r) {
  dame = 0;
  nuo = -1;
  dist = 0;
  dfs3(r);
  if (dame)
    return -1;
  else
    return nuo;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    g[u].push_back(v);
    g[v].push_back(u);
    deg[u]++;
    deg[v]++;
  }
  dfs(0);
  int v1 = 0;
  for (int i = 0; i < n; i++)
    if (d[v1] < d[i]) v1 = i;
  fill(used, used + n, 0);
  d[v1] = 0;
  dfs(v1);
  int v2 = 0;
  for (int i = 0; i < n; i++)
    if (d[v2] < d[i]) v2 = i;
  if (check(v1)) {
    cout << v1 + 1 << endl;
    return 0;
  }
  if (check(v2)) {
    cout << v2 + 1 << endl;
    return 0;
  }
  if (d[v2] & 1) {
    cout << -1 << endl;
    return 0;
  }
  fill(used, used + n, 0);
  dfs2(v2);
  int c = 0;
  for (int i = 0; i < n; i++) {
    if (d[i] == d[v2] / 2 && d2[i] == d[v2] / 2) {
      c = i;
      break;
    }
  }
  if (check(c)) {
    cout << c + 1 << endl;
    return 0;
  }
  fill(used, used + n, 0);
  used[c] = 1;
  bool myon = 0;
  vector<pair<int, int> > w;
  for (auto y : g[c]) {
    int ret = check_path(y);
    if (ret >= 0) {
      if (ret == v1 || ret == v2) myon = 1;
      w.push_back({ret, dist});
    }
  }
  if (w.empty()) {
    cout << -1 << endl;
    return 0;
  }
  if (!myon) {
    if (check(w[0].first)) {
      cout << w[0].first + 1 << endl;
    } else {
      cout << -1 << endl;
    }
  } else {
    for (auto q : w) {
      if (q.second < d[v2] / 2) {
        if (check(q.first)) {
          cout << q.first + 1 << endl;
          return 0;
        } else {
          break;
        }
      }
    }
    cout << -1 << endl;
  }
  return 0;
}
