P, Q, Y = map(int, input().split()) print((Y - 3)%P, (Y-3)%Q)