#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int n;
vector<int> way[maxn];
int deg[maxn];
int len[maxn], lenx[maxn], leny[maxn];
int bad, p[maxn];
int leaf;
void dfs(int u, int last, int cur) {
  len[u] = cur;
  for (auto v : way[u])
    if (v != last) dfs(v, u, cur + 1);
}
void survey(int u, int last, int cur) {
  if (!p[cur])
    p[cur] = deg[u];
  else if (p[cur] != deg[u])
    bad = 1;
  for (auto v : way[u])
    if (v != last) survey(v, u, cur + 1);
}
void dfs2(int u, int last) {
  if (deg[u] == 1 && (leaf == 0 || len[u] < len[leaf])) leaf = u;
  for (auto v : way[u]) {
    if (v == last) continue;
    if (deg[v] <= 2) dfs2(v, u);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    way[u].push_back(v);
    way[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) deg[i] = way[i].size();
  int x = 1, y = 1;
  dfs(1, 0, 0);
  for (int i = 1; i <= n; i++)
    if (len[i] > len[x]) x = i;
  dfs(x, 0, 0);
  for (int i = 1; i <= n; i++) {
    if (len[i] > len[y]) y = i;
    lenx[i] = len[i];
  }
  dfs(y, 0, 0);
  for (int i = 1; i <= n; i++) leny[i] = len[i];
  bad = 0;
  memset(p, 0, sizeof(p));
  survey(x, 0, 0);
  if (!bad) return !printf("%d", x);
  bad = 0;
  memset(p, 0, sizeof(p));
  survey(y, 0, 0);
  if (!bad) return !printf("%d", y);
  int dia = lenx[y], cen = 1;
  for (int i = 1; i <= n; i++)
    if (lenx[i] == dia / 2 && lenx[i] + leny[i] == dia) cen = i;
  bad = 0;
  memset(p, 0, sizeof(p));
  survey(cen, 0, 0);
  if (!bad) return !printf("%d", cen);
  dfs(cen, 0, 0);
  dfs2(cen, 0);
  if (leaf) {
    bad = 0;
    memset(p, 0, sizeof(p));
    survey(leaf, 0, 0);
    if (!bad) return !printf("%d", leaf);
  }
  printf("-1");
  return 0;
}
