#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int n, deg[N], sz[N];
vector<int> g[N], vc[N];
set<int> s[N];
void dfs(int v, int par = -1, int len = 1) {
  s[len].insert(deg[v]);
  for (int to : g[v]) {
    if (to == par) continue;
    dfs(to, v, len + 1);
  }
}
int dfs1(int v, int pr, int &c, int sz) {
  int sum = 1;
  for (int to : g[v]) {
    if (to == pr) continue;
    sum += dfs1(to, v, c, sz);
  }
  if (c == -1 && (sum * 2 >= sz || pr == -1)) {
    c = v;
  }
  return sum;
}
void getsz(int v, int par = -1) {
  sz[v] = 1;
  for (int to : g[v]) {
    if (to == par) continue;
    getsz(to, v);
    sz[v] += sz[to];
  }
}
void bfs(int v, int pr, vector<int> &vv) {
  if (g[v].size() == 1) {
    vv.push_back(v);
  }
  for (int to : g[v]) {
    if (to == pr) continue;
    bfs(to, v, vv);
  }
}
int main() {
  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);
    deg[u]++;
    deg[v]++;
  }
  int ver = -1;
  dfs1(1, -1, ver, n);
  getsz(ver);
  set<int> st;
  for (int to : g[ver]) {
    st.insert(sz[to]);
    bfs(to, ver, vc[sz[to]]);
  }
  if (st.size() <= 2) {
    for (auto x : st) {
      int vr = vc[x].back();
      dfs(vr);
      int cnn = 0;
      for (int i = 1; i <= n; i++) {
        if (s[i].size() > 1) {
          cnn++;
        }
      }
      if (!cnn) {
        cout << vr << endl;
        return 0;
      }
      for (int i = 1; i <= n; i++) s[i].clear();
    }
  }
  dfs(ver);
  for (int i = 1; i <= n; i++) {
    if (s[i].size() > 1) {
      puts("-1");
      return 0;
    }
  }
  cout << ver << endl;
}
