The input starts with a number n, indicating how many operations are there. The next n lines will have 5 integers, separated by a space (let them be a, b, c, d, and e). a indicates the operation: 1 is addition, 2 is subtraction, 3 is multiplication, and 4 is division.