fun c79(args: Array<String>) {
    val numList = args[0].toCharArray().map { it.toString().toInt() }
    fun dfs(current: List<Int>, remaining: List<Int>): List<String> {
        if (remaining.isEmpty()) {
            if (current.sum() == 7) {
                val begin = current[0].toString()
                val center = current.drop(1)
                        .map {
                            val sign = if (it < 0) '-' else '+'
                            val value = Math.abs(it)
                            "$sign$value"
                        }
                        .joinToString("")
                return listOf(begin.plus(center).plus("=7"))
            } else {
                emptyList<String>()
            }
        }
        return remaining.flatMap {
            val plus = dfs(current.plus(it), remaining.minus(it))
            val minus = dfs(current.plus(-it), remaining.minus(it))
            return plus.plus(minus)
        }
    }

    print(dfs(numList.take(1), numList.drop(1)).first())
}

fun main(args: Array<String>) {
    c79(readLineList())
}

fun readLineList(): Array<String> {
    val lineList = mutableListOf<String>()
    while (true) {
        val line = readLine()
        if (line.isNullOrBlank()) {
            break
        } else {
            lineList.add(line!!)
        }
    }
    return lineList.toTypedArray()
}