#include <bits/stdc++.h>
using namespace std;
void getInput();
void getCenter();
void getGoodLeave();
bool isVal(int s);
vector<int> gr[100001], ans;
int n, m, dg[100001], dis[100001], dr[100001], mark[100001], cnt[100001];
queue<int> q;
set<int> dif;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  getInput();
  getCenter();
  getGoodLeave();
  for (int i = 0; i < ans.size(); i++) {
    if (isVal(ans[i])) {
      cout << ans[i];
      return 0;
    }
  }
  cout << -1;
  return 0;
}
void getInput() {
  cin >> n;
  m = n - 1;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    gr[x].push_back(y);
    gr[y].push_back(x);
    dg[x]++, dg[y]++;
  }
}
void getCenter() {
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    if (dg[i] == 1) {
      q.push(i);
      mark[i] = 1;
    }
  }
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < gr[v].size(); i++) {
      int u = gr[v][i];
      if (!mark[u] and --dg[u] == 1) {
        mark[u] = 1;
        dis[u] = dis[v] + 1;
        mx = max(mx, dis[u]);
        q.push(u);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (dis[i] == mx) {
      ans.push_back(i);
    }
  }
}
void getGoodLeave() {
  memset(mark, 0, sizeof(mark));
  memset(dis, 0, sizeof(dis));
  mark[ans[0]] = 1;
  q.push(ans[0]);
  while (!q.empty()) {
    int v = q.front();
    int tmp = 0;
    q.pop();
    for (int i = 0; i < gr[v].size(); i++) {
      if (!mark[gr[v][i]]) {
        tmp++;
      }
    }
    for (int i = 0; i < gr[v].size(); i++) {
      int u = gr[v][i];
      if (!mark[u]) {
        mark[u] = 1;
        q.push(u);
        dis[u] = dis[v] + 1;
        dr[u] = dr[v];
        if (tmp > 1 and dis[v] > 0) {
          dr[u]++;
        }
      }
    }
  }
  int all = 0;
  for (int i = 1; i <= n; i++) {
    dg[i] = gr[i].size();
    if (dr[i] == 0 and dg[i] == 1) {
      all++;
      cnt[dis[i]]++;
      dif.insert(dis[i]);
      if (dif.size() > 2) {
        cout << -1;
        exit(0);
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (dr[i] == 0 and dg[i] == 1 and cnt[dis[i]] == 1) {
      ans.push_back(i);
      continue;
    }
    if (dr[i] == 0 and dg[i] == 1 and cnt[dis[i]] == all) {
      ans.push_back(i);
      break;
    }
  }
}
bool isVal(int s) {
  memset(mark, 0, sizeof(mark));
  memset(dis, 0, sizeof(dis));
  while (!q.empty()) {
    q.pop();
  }
  q.push(s);
  mark[s] = 1;
  while (!q.empty()) {
    int v = q.front();
    q.pop();
    if (!q.empty()) {
      int x = q.front();
      if (dis[v] == dis[x] and dg[v] != dg[x]) {
        return false;
      }
    }
    for (int i = 0; i < gr[v].size(); i++) {
      int u = gr[v][i];
      if (!mark[u]) {
        mark[u] = 1;
        dis[u] = dis[v] + 1;
        q.push(u);
      }
    }
  }
  return true;
}
