Related odd and even positions

Given a non-zero natural nn, compute the sum of the digits in odd positions and the sum of the digits in even positions. If one of the two sums is a multiple of the other, your program has to print the relating factor.

Input

The input is a non-zero natural number 0<n<2310 < n < 2^{31}.

Output

The output consists of two lines. The first line shows the sum of digits in odd positions and the sum of digits in even positions. The second line indicates the relationship among the two quantities, including the exact relation when one is a multiple of the other.

 
Follow the format given in the examples.

Observation

Remember that the last digit of a natural number nn occupies an odd position. For example, for n=212121n=212121, the odd positions are those occupied by 11’s and the even positions are those occupied by 22’s.

 

Problem information

Author: Unknown
Translator: Maria J. Serna

Generation: 2026-01-25T17:38:44.008Z

© Jutge.org, 2006–2026.
https://jutge.org