시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
2 초 256 MB 126 41 36 35.644%

문제

Cube World에서는 모든 유리수를 소수로 표시하고, Baekjoon World에서는 모든 유리수를 분수로 표시합니다. 이때문에 두 나라 간에 오랜 기간 동안 전쟁을 치뤘고, 마침내 서로의 생각을 존중하기로 화해했습니다.

그런데 문제는 Cube World에서 사용하는 소수가 너무 많아서, 이를 모두 Baekjoon World에서 사용하는 분수로 바꾸기는 어렵다는 것이었습니다. 한참을 고민 한 두 나라는 결국 위대한 과학자인 당신에게 도움을 요청해 왔습니다.

Cube World에서는 순환소수를 표시할 때 순환하는 부분을 소괄호로 묶어서 표시합니다. 예를 들어 0.444...는 0.(4)로 표시하는 식입니다. Baekjoon World에서는 분수를 표시할 때 분자와 분모가 서로소가 되도록 하여 표시합니다.

입력

첫 줄에 Cube World에서 사용하는 길이가 10 이하인 소수 하나가 주어집니다. 이 소수는 소수점과 소수 부분이 없을 수도 있고, 순환하는 부분이 없을 수도 있습니다.

출력

첫 줄에 Baekjoon World에서 사용하는 분수로 출력합니다.

예제 입력 1

2015

예제 출력 1

2015/1

예제 입력 2

0.(4)

예제 출력 2

4/9

예제 입력 3

3.(142857)

예제 출력 3

22/7

예제 입력 4

9.(9)

예제 출력 4

10/1
W3sicHJvYmxlbV9pZCI6IjExMDgyIiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMThjXHVjMjE4XHViOTdjIFx1YmQ4NFx1YzIxOFx1Yjg1YyIsImRlc2NyaXB0aW9uIjoiPHA+Q3ViZSBXb3JsZFx1YzVkMFx1YzExY1x1YjI5NCBcdWJhYThcdWI0ZTAgXHVjNzIwXHViOWFjXHVjMjE4XHViOTdjIFx1YzE4Y1x1YzIxOFx1Yjg1YyBcdWQ0NWNcdWMyZGNcdWQ1NThcdWFjZTAsIEJhZWtqb29uIFdvcmxkXHVjNWQwXHVjMTFjXHViMjk0IFx1YmFhOFx1YjRlMCBcdWM3MjBcdWI5YWNcdWM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