// Arup Guha
// 4/20/2019
// Solution 2019 March USACO Gold Problem: Milk Factory

import java.util.*;
import java.io.*;

public class factory {
	
	public static ArrayList[] g;
	public static int n;
	
	public static void main(String[] args) throws Exception {
		
		// Read in the grid.
		Scanner stdin = new Scanner(new File("factory.in"));
		n = stdin.nextInt();
		g = new ArrayList[n];
		for (int i=0; i<n; i++)
			g[i] = new ArrayList<Integer>();
		
		// Trick is to store the graph flipped...in the old graph getting to me is the 
		// same as me getting to you in this new graph.
		for (int i=0; i<n-1; i++) {
			int v2 = stdin.nextInt()-1;
			int v1 = stdin.nextInt()-1;
			g[v1].add(v2);
		}
		
		// Solve and print out the result.
		PrintWriter out = new PrintWriter(new FileWriter("factory.out"));
		out.println(solve());
		out.close();		
		stdin.close();
	}	
	
	// Just try to see if we can reach everything from any vertex, trying them in order.
	public static int solve() {
		for (int i=0; i<n; i++)
			if (canDo(i))
				return i+1;
		return -1;
	}
	
	// See if we can get everywhere from v.
	public static boolean canDo(int v) {
		
		// Do a DFS from v.
		boolean[] used = new boolean[n];
		dfs(v, used);
		
		// See if there is anywhere we didn't get.
		for (int i=0; i<n; i++)
			if (!used[i])
				return false;
		return true;
		
	}
	
	// Run a DFS from v.
	public static void dfs(int v, boolean[] used) {
		used[v] = true;
		for (Integer next: (ArrayList<Integer>)g[v])
			if (!used[next])
				dfs(next, used);
	}
}