
fun main(args:Array<String>):Unit {
    var num = readLine()!!.trim().toInt()
    var weight = maxWeight(num)
    while (weight != 0){
        print(
                when{
                    (weight - 1) / 2 < num -> {
                        num -= weight
                        '+'
                    }
                    (-weight + 1) / 2 > num -> {
                        num += weight
                        '-'
                    }
                    else -> '0'
                }
        )
        weight /= 3
    }
    println()
}
fun maxWeight(num:Int):Int {
    var n = num * 2
    var res = 1
    while (n != 0){
        n /= 3
        res *= 3
    }
    return res / 3
}
