Numbers Inc., a developer of mathematical software, is writing a suite of programs to test the integer arithmetic unit (IAU) of the forthcoming 685.995 microprocessor. Your job at Numbers Inc. is to write a program that correctly adds and subtracts integer numbers up to 40 digits long. This will be used as a standard against which the 685.995 is tested.
Initially, the IAU's accumulator is zero. Each line of the input contains a positive integer up to forty digits long. If the integer is preceded by a +, add it to the accumulator. If the integer is preceded by a -, subtract it from the accumulator. Otherwise, simply set the accumulator to the value of the integer.
The integers have no leading zeros. The end of the input file is indicated by a line containing only a # character.
Print out the value of the accumulator each time it is updated, with leading zeros suppressed.
-123456789123456789 -45454545 +232323233 123466666 -99999 +1000000
-123456789123456789 -123456789168911334 -123456788936588101 123466666 123366667 12436667