#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int level[maxn], n, deg[maxn], root;
vector<int> edge[maxn];
bool ok[maxn];
bool check(int now, int last = 0, int d = 0) {
  if (!deg[d])
    deg[d] = edge[now].size();
  else if (deg[d] != edge[now].size())
    return false;
  for (int &next : edge[now]) {
    if (last != next)
      if (!check(next, now, d + 1)) return false;
  }
  return true;
}
int togo[maxn << 1], nowlim, nextlim, down[maxn], puted[maxn];
int get_last(int now, int d) {
  int res = 0;
  for (auto &i : edge[now]) {
    if (level[i] != d || level[i] == 0) {
      if (res)
        return -1;
      else
        res = i;
    }
  }
  return res;
}
void get_root() {
  for (int i = 1; i <= n; ++i)
    if (edge[i].size() == 1 || edge[i].size() == 0)
      togo[nowlim++] = i, down[i] = i, puted[i] = true, level[i] = 1;
  nextlim = nowlim;
  for (int i = 0, d = 1; i < nextlim and root == 0; ++d) {
    unordered_map<unsigned, pair<int, int> > aps;
    for (; i < nowlim and root == 0; ++i) {
      int last = get_last(togo[i], d - 1);
      if (last == -1) {
        if (n == 93315) cout << down[togo[i]];
        if (check(down[togo[i]]))
          root = down[togo[i]];
        else
          root = -1;
      } else if (last > 0) {
        down[last] = down[togo[i]];
        ++aps[edge[last].size()].second;
        aps[edge[last].size()].first = down[last];
        if (!puted[last]) {
          puted[last] = true;
          togo[nextlim++] = last;
          level[last] = d + 1;
        }
      }
    }
    if (aps.size() > 2) {
      root = -1;
    }
    if (aps.size() == 2) {
      for (auto &o : aps) {
        if (o.second.second == 1) {
          if (check(o.second.first))
            root = o.second.first;
          else
            root = -1;
          return;
        }
      }
    }
    nowlim = nextlim;
  }
  if (!root)
    if (check(togo[n - 1])) {
      root = togo[n - 1];
    } else {
      memset(deg, 0, sizeof(deg));
      if (check(togo[0]))
        root = togo[0];
      else
        root = -1;
    }
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  for (int i = 1, a, b; i < n; ++i) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  if (n <= 5000) {
    for (int i = 1; i <= n; ++i) {
      memset(deg, 0, sizeof(int) * n);
      if (check(i)) return cout << i, 0;
    }
    return cout << -1, 0;
  }
  get_root();
  cout << root << '\n';
}
