#include <bits/stdc++.h>
using namespace std;
template <class T>
void _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(long long &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const long long &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template <class T, class U>
void _W(const pair<T, U> &x) {
  _W(x.first);
  putchar(' ');
  _W(x.second);
}
template <class T>
void _W(const vector<T> &x) {
  for (auto i = x.begin(); i != x.end(); _W(*i++))
    if (i != x.cbegin()) putchar(' ');
}
void W() {}
template <class T, class... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
int MOD = 1e9 + 7;
void ADD(long long &x, long long v) {
  x = (x + v) % MOD;
  if (x < 0) x += MOD;
}
const int SIZE = 1e6 + 10;
vector<int> e[SIZE];
int deg[SIZE];
vector<int> lv[SIZE];
int MA_TT;
void f2(int x, int lt, int tt = 0) {
  MA_TT = max(MA_TT, tt);
  lv[tt].push_back(x);
  for (int y : e[x]) {
    if (y == lt) continue;
    f2(y, x, tt + 1);
  }
}
bool check(int x) {
  for (int i = (0); i <= (MA_TT); ++i) lv[i].clear();
  MA_TT = 0;
  f2(x, x);
  for (int i = (0); i <= (MA_TT); ++i) {
    for (int j = (1); j < (((int)(lv[i]).size())); ++j) {
      if (((int)(e[lv[i][j]]).size()) != ((int)(e[lv[i][0]]).size())) return 0;
    }
  }
  return 1;
}
bool u[SIZE];
int from[SIZE];
bool cmp(int x, int y) { return ((int)(e[x]).size()) < ((int)(e[y]).size()); }
int find(int x) {
  if (!from[x]) return x;
  return find(from[x]);
}
int main() {
  int n;
  R(n);
  if (n == 1) {
    W(1);
    return 0;
  }
  for (int i = (1); i < (n); ++i) {
    int x, y;
    R(x, y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  vector<int> AA[2];
  for (int i = (1); i <= (n); ++i) {
    deg[i] = ((int)(e[i]).size());
    if (((int)(e[i]).size()) == 1) {
      u[i] = 1;
      AA[0].push_back(i);
    }
  }
  int now = 0, nxt = 1;
  while (1) {
    AA[nxt].clear();
    for (int x : AA[now]) {
      for (int y : e[x]) {
        if (!u[y]) {
          u[y] = 1;
          from[y] = x;
          AA[nxt].push_back(y);
        }
      }
    }
    if (((int)(AA[nxt]).size()) == 0) {
      int v = find(AA[now][0]);
      if (check(v)) {
        W(v);
        return 0;
      }
      v = find(AA[now].back());
      if (check(v)) {
        W(v);
        return 0;
      }
      W(-1);
      return 0;
    }
    if (((int)(AA[nxt]).size()) == 1) {
      W(AA[nxt][0]);
      return 0;
    }
    int m = ((int)(AA[nxt]).size());
    sort((AA[nxt]).begin(), (AA[nxt]).end(), cmp);
    if (((int)(e[AA[nxt][0]]).size()) != ((int)(e[AA[nxt][m - 1]]).size())) {
      int v = find(AA[nxt][0]);
      if (check(v)) {
        W(v);
        return 0;
      }
      v = find(AA[nxt][m - 1]);
      if (check(v)) {
        W(v);
        return 0;
      }
      W(-1);
      return 0;
    }
    swap(now, nxt);
  }
  return 0;
}
