cho.sh
Notes
Loading...

Large Integer Arithmetic

Time limit

2s

Memory limit

128 MB

Problem

Given two integers A and B, write a program that calculates A+B, A-B, and A×B.

Input

The first line contains integer A, and the second line contains integer B. Each number is written in decimal notation, has at most 1,000 digits, and may be positive or negative.

Output

Print A+B on the first line, A-B on the second line, and A×B on the third line. Except when the value is 0, an output value must not begin with 0.