#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
vector<int> G[N];
int durer_node, dur;
void dfs1(int u, int p = -1, int d = 1) {
  if (d > dur) {
    dur = d;
    durer_node = u;
  }
  for (int v : G[u]) {
    if (v != p) {
      dfs1(v, u, d + 1);
    }
  }
}
int st, en;
vector<int> nodes;
int dfs2(int u, int p = -1) {
  int fl = 0;
  if (u == en) {
    nodes.push_back(u);
    return 1;
  }
  for (int v : G[u]) {
    if (v != p) {
      fl |= dfs2(v, u);
    }
  }
  if (fl) nodes.push_back(u);
  return fl;
}
set<int> S[N];
void check(int u, int p = -1, int d = 1) {
  S[d].insert(G[u].size());
  for (int v : G[u]) {
    if (v != p) {
      check(v, u, d + 1);
    }
  }
}
int Check(int u) {
  for (int i = 0; i < N; i++) S[i].clear();
  check(u);
  for (int i = 0; i < N; i++) {
    if (S[i].size() > 1) {
      return 0;
    }
  }
  cout << u << endl;
  exit(0);
}
vector<pair<int, int>> bamboo;
int cen;
void dfs3(int u, int p = -1, int d = 1, int mx = 0) {
  if (mx <= 2 && G[u].size() == 1 && u != cen) {
    bamboo.push_back({d, u});
    return;
  }
  if (u != cen) mx = max(mx, (int)G[u].size());
  for (int v : G[u]) {
    if (v != p) {
      dfs3(v, u, d + 1, mx);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  if (n <= 2) {
    cout << 1 << endl;
    return 0;
  }
  dfs1(1);
  dur = 0;
  st = durer_node;
  dfs1(st);
  en = durer_node;
  int dia = dur;
  dfs2(st);
  cen = nodes[dia / 2];
  if (dia & 1) {
    Check(cen);
  }
  dfs3(cen);
  if (bamboo.size() > 0) {
    sort(bamboo.begin(), bamboo.end());
    Check(bamboo[0].second);
    Check(bamboo.back().second);
  }
  cout << "-1";
  return 0;
}
