#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
queue<int> qq;
int rd[N];
int cd[N];
vector<int> vv[N];
int num[N];
vector<int> ss;
void dfs1(int x, int fa, int dep) {
  if (num[dep] == 0 && cd[x] == 1) {
    num[dep] = 1;
    ss.push_back(x);
  }
  for (int i = 0; i < vv[x].size(); i++) {
    int v = vv[x][i];
    if (v == fa) continue;
    if (cd[v] == 2 || cd[v] == 1) dfs1(v, x, dep + 1);
  }
}
int tp() {
  int ans = 1;
  while (!qq.empty()) {
    int x = qq.front();
    qq.pop();
    ans = x;
    for (int i = 0; i < vv[x].size(); i++) {
      int v = vv[x][i];
      rd[v]--;
      if (rd[v] == 1) {
        qq.push(v);
        rd[v] = 0;
      }
    }
  }
  return ans;
}
int f = 1;
void dfs2(int x, int fa, int dep) {
  if (f == 0) return;
  if (num[dep] == 0)
    num[dep] = cd[x];
  else if (num[dep] != cd[x]) {
    f = 0;
    return;
  }
  for (int i = 0; i < vv[x].size(); i++) {
    int v = vv[x][i];
    if (v == fa) continue;
    dfs2(v, x, dep + 1);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    vv[x].push_back(y);
    vv[y].push_back(x);
    cd[x]++;
    cd[y]++;
    rd[x]++;
    rd[y]++;
  }
  for (int i = 1; i <= n; i++) {
    if (rd[i] == 1) {
      rd[i] = 0;
      qq.push(i);
    }
  }
  int root = tp();
  dfs1(root, 0, 1);
  ss.push_back(root);
  for (int i = 0; i < ss.size(); i++) {
    f = 1;
    memset(num, 0, sizeof(num));
    dfs2(ss[i], 0, 1);
    if (f) {
      cout << ss[i] << endl;
      return 0;
    }
  }
  cout << "-1" << endl;
}
