#include <bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> > g;
vector<int> dist1, dist2;
queue<int> q;
int end1 = -1, end2 = -1;
int d, center = -1, noncenter = -1;
vector<set<int> > se;
void bfs(int u, vector<int>& dist) {
  dist.assign(n, -1);
  dist[u] = 0;
  q.push(u);
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int x : g[v]) {
      if (dist[x] == -1) {
        dist[x] = dist[v] + 1;
        q.push(x);
      }
    }
  }
}
void dfs(int u, int p, int dist) {
  se[dist].insert((int)g[u].size());
  for (int v : g[u]) {
    if (v == p) continue;
    dfs(v, u, dist + 1);
  }
}
bool check(int root) {
  if (root == -1) return false;
  se.assign(n, set<int>());
  dfs(root, -1, 0);
  for (int i = 0; i < n; ++i)
    if (se[i].size() > 1) {
      return false;
    }
  return true;
}
int main() {
  cin >> n;
  if (n == 1 || n == 2) {
    cout << 1;
    return 0;
  }
  g.assign(n, vector<int>());
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  bfs(0, dist1);
  for (int i = 0; i < n; ++i)
    if (end1 == -1 || dist1[i] > dist1[end1]) end1 = i;
  bfs(end1, dist1);
  for (int i = 0; i < n; ++i)
    if (end2 == -1 || dist1[i] > dist1[end2]) end2 = i;
  d = dist1[end2];
  bfs(end1, dist1);
  bfs(end2, dist2);
  for (int i = 0; i < n; ++i) {
    if (dist1[i] == dist2[i] && dist1[i] == d / 2) center = i;
    if (g[i].size() == 1 && dist1[i] == dist2[i] && dist1[i] < d) noncenter = i;
  }
  if (check(center))
    cout << center + 1;
  else if (check(noncenter))
    cout << noncenter + 1;
  else if (check(end1))
    cout << end1 + 1;
  else if (check(end2))
    cout << end2 + 1;
  else
    cout << -1;
}
