#include <bits/stdc++.h>
const int N = 1e5 + 5;
std::vector<std::vector<int> > tree;
std::vector<int> degree;
int n;
template <typename T>
void maxi(T& a, T b) {
  a = std::max(a, b);
}
std::pair<int, int> dfs1(int v, int p) {
  std::pair<int, int> ans = {0, v};
  for (int u : tree[v])
    if (u != p) maxi(ans, dfs1(u, v));
  ans.first++;
  return ans;
}
void dfs2(int v, int p, int d, std::bitset<N>& vis) {
  vis[v] = 1;
  if (d) {
    for (int u : tree[v])
      if (u != p) dfs2(u, v, d - 1, vis);
  }
}
int closestReachableLeaf(int root) {
  std::bitset<N> vis;
  std::queue<int> q;
  q.push(root);
  vis[root] = 1;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    if (tree[v].size() == 1) return v;
    for (int u : tree[v]) {
      if (!vis[u] && tree[u].size() <= 2) {
        vis[u] = true;
        q.push(u);
      }
    }
  }
  return -1;
}
bool dfs3(int v, int vdegree, int p) {
  for (int u : tree[v]) {
    if (u != p) {
      if (degree[vdegree + 1] == -1) degree[vdegree + 1] = tree[u].size();
      if (degree[vdegree + 1] != tree[u].size()) return false;
      if (dfs3(u, vdegree + 1, v) == false) return false;
    }
  }
  return true;
}
bool validate(int v) {
  degree.clear();
  degree.resize(n, -1);
  return dfs3(v, 0, -1);
}
int32_t main() {
  scanf("%d", &n);
  tree.resize(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  int u = dfs1(1, -1).second;
  std::pair<int, int> diameter = dfs1(u, -1);
  int v = diameter.second;
  int sz = diameter.first;
  if (validate(u)) return printf("%d\n", u), 0;
  if (validate(v)) return printf("%d\n", v), 0;
  std::bitset<N> uvis, vvis;
  dfs2(u, -1, sz >> 1, uvis);
  dfs2(v, -1, sz >> 1, vvis);
  std::vector<int> mids;
  for (int i = 1; i <= n; i++)
    if (uvis[i] && vvis[i]) mids.push_back(i);
  assert(!mids.empty());
  assert(mids.size() <= 2);
  for (int mid : mids) {
    if (validate(mid)) return printf("%d\n", mid), 0;
    int leaf = closestReachableLeaf(mid);
    if (leaf > 0 && validate(leaf)) return printf("%d\n", leaf), 0;
  }
  puts("-1");
  return 0;
}
