while true
    line = gets.chomp
    break if line == "0 0 0"
    a, b, d = line.split.map(&:to_i)
    arr = []

    i = 0
    while true
        x = d - (i * a)
        break if x.negative?
        if x % b == 0
            arr << [i, x / b]
            break
        end
        i += 1
    end

    i = 0
    while true
        x = d - (i * b)
        break if x.negative?
        break if !arr.empty? && (x / a + i) > (arr[0][0] + arr[0][1])
        if x % a == 0
            arr << [x / a, i]
            break
        end
        i += 1
    end

    i = 0
    while true
        i += 1
        x = (i * a) + d
        break if !arr.empty? && (i + x / b) > (arr[0][0] + arr[0][1])
        if x % b == 0
            arr << [i, x / b]
            break
        end
    end
    arr.sort_by!{|x, y| [x + y, a * x + b * y]}

    i = 0
    while true
        i += 1
        x = (i * b) + d
        break if !arr.empty? && (x / a + i) > (arr[0][0] + arr[0][1])
        if x % a == 0
            arr << [x / a, i]
            break
        end
    end
    arr.sort_by!{|x, y| [x + y, a * x + b * y]}
    
    i = 0
    while true
        i += 1
        x = (i * a) - d
        next if x.negative?
        break if !arr.empty? && (i + x / b) > (arr[0][0] + arr[0][1])
        if x % b == 0
            arr << [i, x / b]
            break
        end
    end
    arr.sort_by!{|x, y| [x + y, a * x + b * y]}

    i = 0
    while true
        i += 1
        x = (i * b) - d
        next if x.negative?
        break if !arr.empty? && (x / a + i) > (arr[0][0] + arr[0][1])
        if x % a == 0
            arr << [x / a, i]
            break
        end
    end
    arr.sort_by!{|x, y| [x + y, a * x + b * y]}

    puts arr[0].join(" ")
end
