output_description: Print an integer representing the position of the first occurrence of a
  multiple of K. (For example, if the first occurrence is the fourth element of
  the sequence, print `4`.)
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      K
attempt: k = int(input())
  
  if k % 2 == 0:
      print(-1)
      exit()
  elif k == 1:
      print(1)
      exit()
  elif k == 11:
      print(2)
      exit()
  elif k == 101:
      print(4)
      exit()
  elif 1001 % k == 0:
      print(6)
      exit()
  elif 10001 % k == 0:
      print(8)
      exit()
  elif 100001 % k == 0:
      print(10)
      exit()
  elif 1000001 % k == 0:
      print(12)
      exit()
  elif 10000001 % k == 0:
      print(14)
      exit()
  elif 100000001 % k == 0:
      print(16)
      exit()
  elif 1000000001 % k == 0:
      print(18)
      exit()
  elif 10000000001 % k == 0:
      print(20)
      exit()
  k = int(input())
  
  if k % 2 == 0:
      print(-1)
      exit()
  elif k == 1:
      print(1)
      exit()
  elif k == 11:
      print(2)
      exit()
  elif k == 101:
      print(4)
      exit()
  elif 1001 % k == 0:
      print(6)
      exit()
  elif 10001 % k == 0:
      print(8)
      exit()
  elif 100001 % k == 0:
      print(10)
      exit()
  elif 1000001 % k == 0:
      print(12)
      exit()
  elif 10000001 % k == 0:
      print(14)
      exit()
  elif 100000001 % k == 0:
      print(16)
      exit()
  elif 1000000001 % k == 0:
      print(18)
      exit()
  elif 10000000001 % k == 0:
      print(20)
      exit()
  elif 100000000001 % k == 0:
      print(22)
      exit()
  elif 1000000000001 % k == 0:
      print(24)
      exit()
  elif 10000000000001 % k == 0:
      print(26)
      exit()
  else:
      print(k - 1)
  
problem_description: Statement
  
  Takahashi loves the number 7 and multiples of K.
  
  Where is the first occurrence of a multiple of K in the sequence
  7,77,777,\ldots? (Also see Output and Sample Input/Output below.)
  
  If the sequence contains no multiples of K, print `-1` instead.
samples: [{"input": "101", "output": "4\n    \n\nNone of 7, 77, and 777 is a multiple of 101, but 7777 is.\n\n* * *"}, {"input": "2", "output": "-1\n    \n\nAll elements in the sequence are odd numbers; there are no multiples of 2.\n\n* * *"}, {"input": "999983", "output": "999982"}]