def min_cost(u, v, d)
  (0..1/0.0).each do |i|
    if (q = d - u * i) % v == 0
      return [i, (q / v).abs]
    end
  end
end

loop do
  a, b, d = gets.split.map(&:to_i)
  break if a == 0
  x1, y1 = min_cost(a, b, d)
  y2, x2 = min_cost(b, a, d)
  s1 = [x1, y1].join(' ')
  s2 = [x2, y2].join(' ')
  if x1 + y1 < x2 + y2
    puts s1
  elsif x1 + y1 > x2 + y2
    puts s2
  else
    puts x1 * a + y1 * b < x2 * a + y2 * b ? s1 : s2
  end
end