public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = in.readLine();
		int n = Integer.parseInt(line);
		int min = Integer.MAX_VALUE;
		int max = Integer.MIN_VALUE;
		boolean a = false;
		int num = -1;
		int index = 0;
		int ini[] = new int[ n ];
		int fin[] = new int[ n ];

		for (int i = 0; i < n; i++) {
			int values[] = atoi(in.readLine());
			ini[i] = values[0];
			fin[i] = values[1];
			if (ini[i] <= min && fin[i] >= max) {
				if (ini[i] == min && fin[i] == max) {
				} else {
					min = ini[i];
					max = fin[i];
					a = true;
					index = i;

				}
				
			} else if (ini[i] < min || fin[i] > max) {
				min = ini[i];
				max = fin[i];
				a = false;

			}
		}
		if (a) {
			System.out.println(index + 1);
		} else {
			System.out.println(-1);
		}
	}