Code with cipher 3 reversed

The code with cipher 3 reversed of a non-negative integer is to code the number in base 3 and revert the coding. In order to make it even more cryptic, you will change the digits of the resulting number according to the following relation: 0 \rightarrow ’-’, 1 \rightarrow ’+’, 2 \rightarrow ’*’.

The code for a negative integer n<0n<0 starts with a ’:’ which is followed by the coding with cipher 3 reversed of n-n.

Examples

Write a program to code integers in cipher 3 reverse coding according to the described algorithm.

Input

The input is a sequence of integer numbers.

Output

The output is the code in cipher 3 reversed of each number.

Follow the format of the examples.

Problem information

Author: Unknown
Translator: Maria Serna

Generation: 2026-01-25T14:14:11.788Z

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