#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using PII = pair<int, int>;
const int N = 1e5 + 10;
int d[N], deg[N], dep[N], parent[N];
vector<int> e[N];
bool chain[N];
bool ok;
void dfs3(int v, int dep, int p) {
  if (!ok) return;
  if (deg[dep] == -1)
    deg[dep] = d[v];
  else if (deg[dep] != d[v])
    ok = false;
  for (auto u : e[v]) {
    if (u == p) continue;
    dfs3(u, dep + 1, v);
  }
}
bool check(int v) {
  memset(deg, -1, sizeof(deg));
  ok = true;
  dfs3(v, 1, 0);
  return ok;
}
void dfs(int v, int p) {
  chain[v] = chain[p] && (d[v] <= 2 || p == 0);
  parent[v] = p;
  dep[v] = dep[p] + 1;
  for (auto u : e[v]) {
    if (u == p) continue;
    dfs(u, v);
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
    d[x]++;
    d[y]++;
  }
  chain[0] = 1;
  dfs(1, 0);
  int v = max_element(dep + 1, dep + n + 1) - dep;
  dfs(v, 0);
  int u = max_element(dep + 1, dep + n + 1) - dep;
  if (check(v))
    return printf("%d\n", v), 0;
  else if (check(u))
    return printf("%d\n", u), 0;
  else if (dep[u] & 1) {
    int t = dep[u] / 2;
    while (t--) u = parent[u];
    if (check(u)) return printf("%d\n", u), 0;
    dfs(u, 0);
    int mx = INT_MAX, u = -1;
    for (int i = 1; i <= n; i++)
      if (d[i] == 1 && chain[i] && dep[i] < mx) {
        mx = dep[i];
        u = i;
      }
    if (u != -1 && check(u)) return printf("%d\n", u), 0;
  }
  puts("-1");
  return 0;
}
