### constant

INF = 1 << 30
MAX_X = 25000

### subroutines

def check(a, b, x, y)
  xy = x + y
  abxy = a * x + b * y
  if $min_xy > xy
    $min_xy = xy
    $min_abxy = abxy
    $min_x = x
    $min_y = y
  elsif $min_xy == xy
    if $min_abxy > abxy
      $min_abxy = abxy
      $min_x = x
      $min_y = y
    end
  end
end

### main

loop do
  a, b, d = gets.split.map(&:to_i)
  break if (a | b | d) == 0
  #p [a, b, d]

  $min_xy = INF
  $min_axby = INF
  $min_x = $min_y = nil

  for x in (0..MAX_X)
    # ax+d = by
    r = a * x + d
    if r % b == 0
      y = r / b
      check(a, b, x, y)
    end

    # ax = by+d
    r = a * x - d
    if r >= 0 && r % b == 0
      y = r / b
      check(a, b, x, y)
    end

    # ax + by = d
    r = d - a * x
    if r >= 0 && r % b == 0
      y = r / b
      check(a, b, x, y)
    end
  end

  puts [$min_x, $min_y].join(' ')
end