import scala.io.StdIn.* def solve(n: Int, m: Int): List[Int] = m match case 1 => List(n) case _ => (n / m) :: solve(m, n % m) @main def main = val Array(n, m) = readLine().split(' ').map(_.toInt) val result = solve(n, m) println(result.mkString(" "))