12909 - Big number subtraction   

Description

In the most of arithmetic subtraction case, we can simply use int or long long to store the two integers and compute the answer by the operater ' - ' in C. If we have two big integers that can not be stored into the varibles mentioned below, we should make use of arrays to complete the subtraction task.

Given two big number A, B, please compute A - B.

[Hint]

To solve this problem, we can imitate the straight addition we have learned in elementary school. Here are some tips:

1. Use arrays to store the two big numbers, and then subtract them one by one from low digit to high digit.

2. If A > B, you can directly switch them and add ' - ' in the final answer to make the calculation easy.

(This problem is a little bit hard. If you have no idea, you can google "Big number subtraction" to learn the implementation detail.)

Input

First line contains an integer which denotes the length of  A. The following one line contains the big integer A.

Third line contains an integer which denotes the length of  B. The following one line contains the big integer B.

(1 ≤  number of digits of A, B ≤ 100, both A and B are positive integers)

Output

An integer which denotes the answer of A -B. (Answer can be negative)

Note that you don't need to print '\n' at the end of the output

Sample Input  Download

Sample Output  Download

Tags




Discuss