This page is still under construction.

Parts of this page are still being built. What you see may change.

Knot Knowledge

Interview

Time limit1sMemory limit1024 MB

Summary
Given n knots to learn and the n-1 already learned, print the one knot still missing.
Level

Easy2 of 10

Topics
Array, Hash map, Implementation
Solved
No attempts yet

Problem

Sonja the scout is taking a test to see if she knows all the knots a scout is supposed to know. The Scout's Big Book of Knots has descriptions of 1 0001\,000 different knots, conveniently numbered from 11 to 1 0001\,000. For the test, Sonja needs to learn a specific set of nn of these knots. After some intense studying, she has learned all except one of them, but she has forgotten which knot she does not yet know.

Given the list of knots Sonja needs to learn, and the ones she has learned so far, find the remaining knot to learn.

Input

The first line of input consists of an integer nn (2≤n≤502 \le n \le 50), the number of knots Sonja needs to learn. This is followed by a line containing nn distinct integers x1,…,xnx_1, \ldots, x_n (1≤xi≤1 0001 \le x_i \le 1\,000), the knots that Sonja needs to learn. Finally, the last line contains n−1n-1 distinct integers y1,…,yn−1y_1, \ldots, y_{n-1} (1≤yi≤1 0001 \le y_i \le 1\,000), the knots that Sonja has learned so far. You may assume that each knot Sonja has learned is one of the nn knots she was supposed to learn.

Output

Output the number of the remaining knot that Sonja needs to learn.

Examples2

  1. Example 1

    Input
    4
    1 2 4 3
    4 2 3
    
    Expected output
    1
    
  2. Example 2

    Input
    4
    10 101 999 1
    1 999 101
    
    Expected output
    10