#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[1000000], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
template <typename T>
inline T frd(T x) {
  int f = 1;
  char ch = gc();
  for (; ch < '0' || ch > '9'; ch = gc())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = gc()) x = (x << 1) + (x << 3) + ch - '0';
  return x * f;
}
template <typename T>
inline T read(T x) {
  int f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar())
    x = (x << 1) + (x << 3) + ch - '0';
  return x * f;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) print(x / 10);
  putchar(x % 10 + '0');
}
const int N = 1e5;
int pre[(N << 1) + 10], now[N + 10], child[(N << 1) + 10];
int Rem[N + 10], sz[N + 10], Deg[N + 10], dis[N + 10], vis[N + 10],
    Endl[N + 10];
int tot, root, Min, Max, n;
void join(int x, int y) { pre[++tot] = now[x], now[x] = tot, child[tot] = y; }
void insert(int x, int y) { join(x, y), join(y, x); }
void Dfs(int x, int fa) {
  sz[x] = 1;
  for (int p = now[x]; p; p = pre[p]) {
    int son = child[p];
    if (son == fa) continue;
    Dfs(son, x);
    sz[x] += sz[son];
    if (sz[Rem[x]] < sz[son]) Rem[x] = son;
  }
  if (Min > max(sz[Rem[x]], n - sz[x])) {
    root = x;
    Min = max(sz[Rem[x]], n - sz[x]);
  }
}
void Dfs_Line(int x, int fa, int distance) {
  if (Deg[x] > 2) return;
  if (Deg[x] == 1) {
    Endl[x] = distance;
    return;
  }
  for (int p = now[x]; p; p = pre[p]) {
    int son = child[p];
    if (son == fa) continue;
    Dfs_Line(son, x, distance + 1);
  }
}
int H[N + 10];
bool check(int x) {
  memset(vis, -1, sizeof(vis));
  memset(dis, -1, sizeof(dis));
  int head = 0, tail = 1;
  dis[H[1] = x] = 0;
  while (head != tail) {
    int Now = H[++head];
    for (int p = now[Now]; p; p = pre[p]) {
      int son = child[p];
      if (~dis[son]) continue;
      dis[son] = dis[Now] + 1;
      if (!~vis[dis[son]]) vis[dis[son]] = Deg[son];
      if (vis[dis[son]] != Deg[son]) return false;
      H[++tail] = son;
    }
  }
  return true;
}
int main() {
  n = read(0), Min = 0x7f7f7f7f;
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  for (int i = 1; i < n; i++) {
    int x = read(0), y = read(0);
    insert(x, y);
    Deg[x]++, Deg[y]++;
  }
  Dfs(1, 0);
  if (check(root)) {
    printf("%d\n", root);
    return 0;
  }
  for (int p = now[root]; p; p = pre[p]) {
    int son = child[p];
    Dfs_Line(son, root, 1);
  }
  Max = -0x7f7f7f7f, Min = 0x7f7f7f7f;
  int Max_ID = 0, Min_ID = 0;
  for (int i = 1; i <= n; i++) {
    if (!Endl[i]) continue;
    if (Max < Endl[i]) Max = Endl[Max_ID = i];
    if (Min > Endl[i]) Min = Endl[Min_ID = i];
  }
  if (Max_ID && check(Max_ID)) {
    printf("%d\n", Max_ID);
    return 0;
  }
  if (Min_ID && check(Min_ID)) {
    printf("%d\n", Min_ID);
    return 0;
  }
  printf("-1\n");
  return 0;
}
