A utility stores each meter reading as a singly linked chain of decimal digits, most-significant digit at the head (natural reading order). Given two such readings, compute their sum and output it as a digit chain, most-significant digit first, with no leading zeros (the value zero is the single digit 0). Input chains may contain leading zeros; the value is the number they spell.
Input format
Line 1: an integer p, the number of digits in reading A (p >= 1).
Line 2: p space-separated digits (each 0-9) of reading A, most-significant first.
Line 3: an integer q, the number of digits in reading B (q >= 1).
Line 4: q space-separated digits (each 0-9) of reading B, most-significant first.
Output format
Line 1: the number of digits in the sum. Line 2: the digits of the sum, most-significant first, space-separated, with no leading zeros.
Constraints
- 1 <= p, q <= 5000
- Each digit is between 0 and 9.