Sequinary Numerals
题号:NC236493
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

A sequinary numeral is a sequence of digits:
 
 where d_n is  or and the others are 0,1, or
It represents the rational number: 
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  digits. 

输出描述:

Output consists of a single line. 
If the result is an integer, the output is the decimal integer. Otherwise, the output is a single space and  where , and are decimal integers where  and  is in lowest terms ().
示例1

输入

复制
2101

输出

复制
10
示例2

输入

复制
201

输出

复制
5 1/2