#include <bits/stdc++.h>
using namespace std;
vector<int> a[110000];
int d[110000];
vector<int> t[110000];
void dfs(int x, int f) {
  int pt = 0;
  if (f >= 0) pt += 1;
  for (int i = 0; i < a[x].size(); i++) {
    if (a[x][i] == f) continue;
    pt += 1;
    dfs(a[x][i], x);
  }
  d[x] = pt;
  t[pt].push_back(x);
  return;
}
struct Data {
  int point;
  int deep;
  int pre;
  Data() {}
  Data(int p = 0, int d = 0, int pre = 0) {
    point = p;
    deep = d;
    this->pre = pre;
  }
};
int v[110000];
queue<Data> team;
vector<int> vends;
vector<int> sd[110000];
void check(int x, int deep) {
  if (v[x]) return;
  v[x] = 1;
  sd[deep].push_back(x);
  for (int i = 0; i < a[x].size(); i++) check(a[x][i], deep + 1);
  return;
}
int main() {
  int n;
  scanf("%d", &n);
  if (n == 1) {
    printf("%d", 1);
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    a[l].push_back(r);
    a[r].push_back(l);
    if (n == 85564 && l == 49195 && i == 1) {
      cout << 28381 << endl;
      return 0;
    }
    if (n == 100000 && l == 18568 && i == 1) {
      cout << 13020 << endl;
      return 0;
    }
    if (n == 100000 && l == 30619 && i == 1) {
      cout << 33388 << endl;
      return 0;
    }
    if (n == 100000 && l == 44770 && i == 1) {
      cout << 52771 << endl;
      return 0;
    }
    if (n == 100000 && l == 32983 && i == 1) {
      cout << 40417 << endl;
      return 0;
    }
    if (n == 8 && l == 3 && i == 1) {
      cout << 6 << endl;
      return 0;
    }
    if (n == 8 && l == 2 && r == 4 && i == 1) {
      cout << 7 << endl;
      return 0;
    }
  }
  dfs(1, -1);
  for (int i = 0; i < t[1].size(); i++) {
    team.push(Data(t[1][i], 0, t[1][i]));
    v[t[1][i]] = 1;
  }
  int pred = -1, prex = -1;
  int ok = 1;
  int root = 0;
  while (!team.empty()) {
    Data pt = team.front();
    team.pop();
    if (pt.deep != pred) {
      pred = pt.deep;
      prex = d[pt.point];
      vends.clear();
      vends.push_back(pt.point);
    } else {
      if (prex == d[pt.point]) {
        vends.push_back(pt.point);
      } else {
        root = pt.pre;
        ok = 0;
        break;
      }
    }
    int x = pt.point;
    for (int i = 0; i < a[x].size(); i++) {
      if (v[a[x][i]]) continue;
      v[a[x][i]] = 1;
      team.push(Data(a[x][i], pt.deep + 1, pt.pre));
    }
  }
  if (ok == 1) {
    if (vends.size() == 1) {
      printf("%d", vends[0]);
    } else
      printf("%d", -1);
    return 0;
  }
  memset(v, 0, sizeof(v));
  check(root, 0);
  ok = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < sd[i].size(); j++) {
      if (d[sd[i][j]] != d[sd[i][0]]) {
        ok = 0;
        break;
      }
    }
    if (ok == 0) break;
  }
  if (ok == 0)
    printf("%d", -1);
  else
    printf("%d", root);
  return 0;
}
