loop do
    a, b, d = gets.split.map(&:to_i)
    break if a == 0 && b == 0 && d == 0
    l = 0
    r = d
    x = y = 0
    while (r - l) % b != 0
        x += 1
        l += a
    end
    y = ((r - l) / b).abs
    l = 0
    r = d
    x2 = y2 = 0
    while (r - l) % a != 0
        y2 += 1
        l += b
    end
    x2 = ((r - l) / a).abs
    x, y = x2, y2 if x2 + y2 < x + y || a * x2 + b * y2 < a * x + b * y
    l = 0
    r = d
    x2 = y2 = 0
    while l <= d
        if (r - l) % b == 0
            y2 = (r - l) / b
            x, y = x2, y2 if x2 + y2 < x + y || a * x2 + b * y2 < a * x + b * y
        end
        x2 += 1
        l += a
    end
    puts [x,y] * " "
end