def f(x)
    return {} if x == 0
    k = 0
    k += 1 until (x - 3 ** k).abs <= (3 ** k - 1) / 2
    if x >= 3 ** k
        return f(x - 3 ** k).merge({ k => ?+ })
    else
        h = f(3 ** k - x)
        h.each {|k, v| h[k] = (v == ?+ ? ?- : ?+)}
        return h.merge({ k => ?+ })
    end
end
x = gets.to_i
h = f(x)
puts (0..h.keys.max).map {|k| h[k] || ?0}.reverse * ''
