T = int(input()) for _ in range(T): A, B, C = map(int, input().split()) print(A * (10 ** C) // C % 10)