#include <bits/stdc++.h>
using namespace std;
inline bool ZXBs_fast_input(int& x) {
  x = 0;
  int c;
  int sign = 1;
  while ((c = getchar()) < '0' || c > '9')
    if (c == '-') sign = -1;
  x = c ^ '0';
  while ((c = getchar()) >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ '0');
  x *= sign;
  return 1;
}
inline bool ZXBs_fast_output(int x) {
  if (x >= 10) ZXBs_fast_output(x / 10);
  putchar(x % 10 + '0');
  return 1;
}
const int rp = 666666;
const bool debug = 1;
const bool I_good_vegetable_a = 1;
int n;
vector<int> tree[100100];
int par[100100];
int cntdeg[100100];
bool used[100100];
bool done[100100];
int pos = -1;
bool eql = 0;
int dfs(int now, int lst) {
  par[now] = lst;
  int ans = 1;
  for (int i = 0; i < tree[now].size(); i++) {
    if (tree[now][i] != lst) {
      int dfsdone = dfs(tree[now][i], now);
      ans += dfsdone;
    }
  }
  if (ans >= (n - ans) && pos < 0) {
    pos = now;
    if (ans == (n - ans)) eql = 1;
  }
  return ans;
}
bool check(int now) {
  memset(used, 0, sizeof(used));
  queue<int> q1, q2;
  q1.push(now);
  used[now] = 1;
  while (!q1.empty()) {
    int deg = tree[q1.front()].size();
    while (!q1.empty()) {
      int wa = q1.front();
      q1.pop();
      used[wa] = 1;
      if (tree[wa].size() != deg) {
        return 0;
      }
      for (int i = 0; i < tree[wa].size(); i++) {
        if (!used[tree[wa][i]]) {
          q2.push(tree[wa][i]);
        }
      }
    }
    swap(q1, q2);
  }
  return 1;
}
bool single_check(int now, int pre) {
  int len = 1;
  while (tree[now].size() == 2) {
    int ha = now;
    if (tree[now][0] == pre)
      now = tree[now][1];
    else
      now = tree[now][0];
    pre = ha;
    len++;
  }
  if (tree[now].size() == 1) {
    if (done[len]) return 0;
    if (check(now)) {
      cout << now + 1 << endl;
      exit(0);
    }
    done[len] = 1;
  }
  return 0;
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    tree[a].push_back(b);
    tree[b].push_back(a);
  }
  dfs(0, -1);
  if (!eql) {
    if (check(pos)) {
      cout << (pos + 1) << endl;
      return 0;
    }
    for (int i = 0; i < tree[pos].size(); i++) {
      int now = tree[pos][i];
      if (tree[now].size() <= 2) {
        single_check(now, pos);
      }
    }
    cout << "-1" << endl;
  } else {
    int x = pos, y = par[pos];
    memset(done, 0, sizeof(done));
    single_check(x, y);
    memset(done, 0, sizeof(done));
    single_check(y, x);
    cout << "-1" << endl;
  }
  return 0;
}
