#abc120b. [abc120_b]K-th Common Divisor

[abc120_b]K-th Common Divisor

Problem Statement

You are given positive integers AA and BB.

Find the KK-th largest positive integer that divides both AA and BB.

The input guarantees that there exists such a number.

Constraints

  • All values in input are integers.
  • 1leqA,Bleq1001 \\leq A, B \\leq 100
  • The KK-th largest positive integer that divides both AA and BB exists.
  • Kgeq1K \\geq 1

Input

Input is given from Standard Input in the following format:

AA BB KK

Output

Print the KK-th largest positive integer that divides both AA and BB.


Sample Input 1

8 12 2

Sample Output 1

2

Three positive integers divides both 88 and 1212: 1,21, 2 and 44. Among them, the second largest is 22.


Sample Input 2

100 50 4

Sample Output 2

5

Sample Input 3

1 1 1

Sample Output 3

1