output_description: Print the number of times Takahashi and Aoki will meet each other.  
  If they meet infinitely many times, print `infinity` instead.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      T_1 T_2
      A_1 A_2
      B_1 B_2
attempt: def main():
      t1, t2 = map(int, input().split(" "))
      a1, a2 = map(int, input().split(" "))
      b1, b2 = map(int, input().split(" "))
  
      dist1 = a1 * t1 + a2 * t2
      dist2 = b1 * t1 + b2 * t2
      if dist1 == dist2:
          return "infinity"
      elif a1 == b1:
          return "infinity"
      elif a2 == b2:
          return 0
      elif (a1 < b1 and a2 < b2) or (b1 < a1 and b2 < a2):
          return 0
  
      if dist1 > dist2:
          a = a1 * t1
          b = a2 * t2
          c = b1 * t1
          d = b2 * t2
      else:
          a = b1 * t1
          b = b2 * t2
          c = a1 * t1
          d = a2 * t2
  
      m = (c - a) // (a + b - c - d)
      out = 2 * m + 1
  
      return out
  
  
  out = main()
  print(out)
  
problem_description: Statement
  
  Takahashi and Aoki are training for long-distance races in an infinitely long
  straight course running from west to east.
  
  They start simultaneously at the same point and moves as follows **towards the
  east** :
  
    * Takahashi runs A_1 meters per minute for the first T_1 minutes, then runs at A_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.
    * Aoki runs B_1 meters per minute for the first T_1 minutes, then runs at B_2 meters per minute for the subsequent T_2 minutes, and alternates between these two modes forever.
  
  How many times will Takahashi and Aoki meet each other, that is, come to the
  same point? We do not count the start of the run. If they meet infinitely many
  times, report that fact.
samples: [{"input": "1 2\n    10 10\n    12 4", "output": "1\n    \n\nThey will meet just once, \\frac{4}{3} minutes after they start, at\n\\frac{40}{3} meters from where they start.\n\n* * *"}, {"input": "100 1\n    101 101\n    102 1", "output": "infinity\n    \n\nThey will meet 101, 202, 303, 404, 505, 606, ... minutes after they start,\nthat is, they will meet infinitely many times.\n\n* * *"}, {"input": "12000 15700\n    3390000000 3810000000\n    5550000000 2130000000", "output": "113\n    \n\nThe values in input may not fit into a 32-bit integer type."}]