output_description: Print the number of times the action will be performed by the three people, if
  this number is finite. If it is infinite, print `-1` instead.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: s = list(input().split())
  n = int(input())
  t = [input() for i in range(n)]
  r = []
  for x in s:
      for y in t:
          if len(x) == len(y):
              l = list(x)
              for z in range(len(x)):
                  if y[z] == "*":
                      l[z] = "*"
              if "".join(l) == y:
                  r.append("*" * len(x))
                  break
      else:
          r.append(x)
  print(*r)
  
problem_description: Statement
  
  Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies,
  respectively. Now, they will exchange those cookies by repeating the action
  below:
  
    * Each person simultaneously divides his cookies in half and gives one half to each of the other two persons.
  
  This action will be repeated until there is a person with odd number of
  cookies in hand.
  
  How many times will they repeat this action? Note that the answer may not be
  finite.
samples: [{"input": "4 12 20", "output": "3\n    \n\nInitially, Takahashi, Aoki and Snuke have 4, 12 and 20 cookies. Then,\n\n  * After the first action, they have 16, 12 and 8.\n  * After the second action, they have 10, 12 and 14.\n  * After the third action, they have 13, 12 and 11.\n\nNow, Takahashi and Snuke have odd number of cookies, and therefore the answer\nis 3.\n\n* * *"}, {"input": "14 14 14", "output": "-1\n    \n\n* * *"}, {"input": "454 414 444", "output": "1"}]