Continuing their research on graphics cards, the team has not reached a point where they need several calculations per pair of numbers. The team is currently testing their code, so they ask you to write a program that would validate addition, subtraction, and multiplication of numbers modulo m.
Given two lists of integers and , you are asked to calculate:
As it’s faster to perform similar calculations on a GPU, you are asked to first print all the results for addition, then all the results for subtraction, and then all the results for multiplication.
Input
The first line of the input contains two integers n (1 ≤ n ≤ 100 000) and m (1 ≤ m ≤ ).
The second line contains n space-separated integers ( ≤ ≤ ).
The next line contains n space-separated integers ( ≤ ≤ ).
Output
The first line of the output should contain all the additions separated by a space .
The second line should contain all the subtractions separated by a space .
The final line should contain all the multiplications separated by a space .