output_description: Print the K-th largest positive integer that divides both A and B.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B K
attempt: # Common Division
  Ai, Bi, K = map(int, input().strip().split())
  A = max([Ai, Bi])
  B = min([Ai, Bi])
  
  if A % B == 0:
      rnk = 1
  else:
      rnk = 0
  S = B // 2
  s = B
  print("S is {}".format(S))
  for s in range(1, S + 1)[::-1]:
      print("s is {}".format(s))
      if A % s == 0 and B % s == 0:
          rnk += 1
          if rnk == K:
              break
  print(s)
  
problem_description: Statement
  
  You are given positive integers A and B.
  
  Find the K-th largest positive integer that divides both A and B.
  
  The input guarantees that there exists such a number.
samples: [{"input": "8 12 2", "output": "2\n    \n\nThree positive integers divides both 8 and 12: 1, 2 and 4. Among them, the\nsecond largest is 2.\n\n* * *"}, {"input": "100 50 4", "output": "5\n    \n\n* * *"}, {"input": "1 1 1", "output": "1"}]