#include <bits/stdc++.h>
using namespace std;
const int mx = 1e5 + 10;
vector<int> g[mx];
int n, rt, sz[mx], ma = 1e9;
bool vis[mx];
void dfs_rt(int u, int fa) {
  int c = 0;
  sz[u] = 1;
  for (int v : g[u]) {
    if (v == fa) continue;
    dfs_rt(v, u);
    sz[u] += sz[v];
    c = max(c, sz[v]);
  }
  c = max(c, n - sz[u]);
  if (c < ma) ma = c, rt = u;
}
bool dfs(int u, int fa, int d) {
  if (!sz[d])
    sz[d] = g[u].size();
  else if (g[u].size() != sz[d])
    return 0;
  for (int v : g[u]) {
    if (v == fa) continue;
    if (!dfs(v, u, d + 1)) return 0;
  }
  return 1;
}
bool check(int u) {
  memset(sz, 0, sizeof(sz));
  return dfs(u, 0, 0);
}
int line(int u, int fa, int d) {
  if (u == rt) return d;
  if (g[u].size() > 2) return 0;
  for (int v : g[u])
    if (v != fa) return line(v, u, d + 1);
}
int main() {
  scanf("%d", &n);
  int u, v;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &u, &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs_rt(1, 0);
  if (check(rt)) return 0 * printf("%d\n", rt);
  for (int i = 1; i <= n; i++) {
    if (g[i].size() == 1) {
      int d = line(i, 0, 0);
      if (d && !vis[d]) {
        vis[d] = 1;
        if (check(i)) return 0 * printf("%d\n", i);
      }
    }
  }
  puts("-1");
  return 0;
}
