output_description: If S is a Hitachi string, print `Yes`; otherwise, print `No`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S
attempt: import sys
  
  lines = sys.stdin.readlines()
  
  num_a, num_b, num_m = [int(v) for v in lines[0].split()]
  # ----
  
  a_list = [int(v) for v in lines[1].split()[: num_a + 1]]
  b_list = [int(v) for v in lines[2].split()[: num_b + 1]]
  
  # print(a_list)
  # print(b_list)
  
  result = max(a_list) + max(b_list)
  # ignores = set()
  for c in lines[3 : num_m + 3]:
      a_i, b_i, discount = map(int, c.split())
      try:
          #         ignores.add((int(a_i), int(b_i)))
          price = a_list[a_i - 1] + b_list[b_i - 1] - discount
  
          if price < result:
              result = price
      except IndexError:
          print("------")
          print(c)
          pass
  
  res1 = [
      a_list[a_i - 1] + b_list[b_i - 1] - discount
      for a_i, b_i, discount in [map(int, l.split()) for l in lines[3 : num_m + 3]]
  ]
  
  
  res2 = [a + b for b in b_list for a in a_list]
  
  print(min(min(res1), min(res2)))
  
problem_description: Statement
  
  A Hitachi string is a concatenation of one or more copies of the string `hi`.
  
  For example, `hi` and `hihi` are Hitachi strings, while `ha` and `hii` are
  not.
  
  Given a string S, determine whether S is a Hitachi string.
samples: [{"input": "hihi", "output": "Yes\n    \n\n`hihi` is the concatenation of two copies of `hi`, so it is a Hitachi string.\n\n* * *"}, {"input": "hi", "output": "Yes\n    \n\n* * *"}, {"input": "ha", "output": "No"}]