fun main( args : Array ) { val (a, b, c) = readLine()!!.split(" ").map { it.toInt() } // c = n * b + d // b = n * a + d val n = (c - b) / (b - a).toDouble() val d = c - n * b println("${(n*c + d).toInt()}") }