#include <bits/stdc++.h>
using namespace std;
const int maxn = 100001;
int level[maxn], n, deg[maxn];
vector<int> edge[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 get_last(int now, int d) {
  int res = 0;
  for (int &i : edge[now]) {
    if (level[i] != d + 1) {
      if (res)
        return -1;
      else
        res = i;
    }
  }
  return res;
}
int get_root() {
  static int togo[maxn] = {};
  static int leaf[maxn] = {};
  static int put[maxn] = {1};
  static int dq[maxn] = {};
  int now_lim = 0, next_lim;
  for (int i = 1; i <= n; ++i) {
    if (edge[i].size() == 1)
      togo[now_lim++] = i, level[i] = n, put[i] = true, leaf[i] = i;
  }
  next_lim = now_lim;
  if (check(togo[0])) return togo[0];
  memset(deg, 0, sizeof(deg));
  for (int i = 0, d = n; i < n; --d) {
    unordered_map<unsigned, pair<int, int> > aps;
    for (; i < now_lim; ++i) {
      int &now = togo[i], last = get_last(togo[i], d);
      if (last == -1) {
        if (check(leaf[now]))
          return leaf[now];
        else
          return -1;
      } else if (last == 0) {
        if (check(now))
          return now;
        else
          return -1;
      } else {
        if (!put[last]) {
          togo[next_lim++] = last;
          leaf[last] = leaf[now];
          put[last] = true;
        }
        ++dq[last];
      }
    }
    for (int j = now_lim; j < next_lim; ++j) {
      int &now = togo[j];
      ++aps[dq[now]].second;
      aps[dq[now]].first = leaf[now];
      level[togo[j]] = d - 1;
    }
    if (aps.size() > 2) {
      return -1;
    }
    if (aps.size() == 2) {
      for (auto &j : aps) {
        if (j.second.second == 1) {
          if (check(j.second.first))
            return j.second.first;
          else
            return -1;
        }
      }
    }
    now_lim = next_lim;
  }
  if (check(togo[n - 1]))
    return togo[n - 1];
  else
    return -1;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  if (n == 1) return cout << 1 << '\n', 0;
  for (int i = 1, a, b; i < n; ++i) {
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }
  cout << get_root();
}
