fun main() {
    val (a, b) = readLine()!!.split(" ").map { it.toInt() }
    val ops = actions(a * a, b * b).toList()
    println(ops.size)
    println(ops.joinToString(" "))
}

/** 0 -> sqrt(a / b) */
fun actions(a: Int, b: Int): Sequence<String> = when {
    (a == b) -> sequenceOf("cos")
    (a > b) -> actions(b, a) + sequenceOf("atan", "sin", "acos", "tan")
    else -> actions(a, b - a) + sequenceOf("atan", "sin")
}
