#include <bits/stdc++.h>
using namespace std;
void ga(int N, int *A) {
  for (int i(0); i < N; i++) scanf("%d", A + i);
}
vector<int> g[(100009)];
void dw(int u, int p, int d, int *D) {
  D[u] = d;
  for (auto i : g[u])
    if (i ^ p) dw(i, u, d + 1, D);
}
pair<int, int> ctr(int N, int l = 0) {
  static int D[(100009)], U[(100009)], d;
  pair<int, int> B;
  dw(l, -1, 0, D), dw(max_element(D, D + N) - D, -1, 0, D);
  dw(l = max_element(D, D + N) - D, -1, 0, U), d = D[l] >> 1;
  for (int i(0); i < N; i++)
    if (D[i] == U[i] && D[i] == d) return {i, -1};
  for (int i(0); i < N; i++)
    if (D[i] == d && U[i] == d + 1)
      B.second = i;
    else if (D[i] == d + 1 && U[i] == d)
      B.first = i;
  return B;
}
vector<int> f;
int N, a, b, D[(100009)], V[(100009)];
void dd(int u, int p, int d) {
  if (g[u].size() == 1u && !V[d]++) f.push_back(u);
  for (auto &h : g[u])
    if (h ^ p) dd(h, u, d + 1);
}
bool dfs(int u, int p, int d) {
  if (!D[d]) D[d] = g[u].size();
  if (D[d] ^ g[u].size()) return 0;
  for (auto &h : g[u])
    if (h ^ p && !dfs(h, u, d + 1)) return 0;
  return 1;
}
int main(void) {
  scanf("%d", &N);
  for (int i(0); i < N - 1; i++)
    scanf("%d%d", &a, &b), g[--a].push_back(--b), g[b].push_back(a);
  pair<int, int> w = ctr(N);
  if (dfs(w.first, w.first, 0)) return printf("%d\n", w.first + 1), 0;
  for (int i(0); i < N; i++)
    if (g[i].size() == 1u) dd(i, i, 0), i = N;
  (memset(V, 0, sizeof(V)));
  for (int i = N - 1; ~i; --i)
    if (g[i].size() == 1u) dd(i, i, 0), i = 0;
  for (auto &h : f)
    if ((memset(D, 0, sizeof(D))), dfs(h, h, 0))
      return printf("%d\n", h + 1), 0;
  puts("-1");
  return 0;
}
