A sequinary numeral is a sequence of digits:
dndn-2...d1d0
where dn is 1 or 2 and the others are 0, 1, or 2.
It represents the rational number:
d0 + d1 * (3/2) + d2 * (3/2)2 + ... + dn * (3/2)n
Write a program which takes a sequinary numeral as input and returns the number it represents as a proper fraction.
The single line of input contains a sequinary numeral of no more than 32 digits.
Output consists of a single line.
If the result is an integer, the output is the decimal integer. Otherwise, the output is N a single space and K/M where N, K and M are decimal integers where K < M and K/M is in lowest terms (GCD(K, M) = 1).