Two whole numbers are each encoded as a singly linked list of decimal digits (0-9), one digit per node, with the LEAST SIGNIFICANT digit at the head of the list (so each list stores the number's digits in reverse order). Neither list has a leading zero at its most-significant digit (the last printed digit), UNLESS the list represents the single-digit number 0. Given both linked lists, print the sum of the two numbers as a single decimal integer.
Input format
Line 1: an integer n1 — the length of the first digit chain.
Line 2: n1 space-separated digits (0-9), least-significant-digit first.
Line 3: an integer n2 — the length of the second digit chain.
Line 4: n2 space-separated digits (0-9), least-significant-digit first.
Output format
A single non-negative integer: the sum, in standard decimal notation with no extra leading zeros (except the number 0 itself).
Constraints
- 1 ≤ n1, n2 ≤ 100000
- each digit is between 0 and 9
- the most-significant digit of each chain is nonzero, unless the chain is exactly one node with digit 0