output_description: If a is not less than 3200, print s; if a is less than 3200, print `red`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      a
      s
attempt: def check(t, s):
      i = 0
      for j in range(len(s)):
          if i == len(t):
              return (True, j)
          if t[i] == s[j]:
              i += 1
      if i == len(t):
          return (True, len(s))
      return False, -1
  
  
  def solve(s, t):
      new_s = s
      for a in t:
          if a not in s:
              return -1
      l = 1
      r = 1005
      final = 10**100
      while l <= r:
          mid = (l + r) // 2
          new_s = s * mid
          done, ans = check(t, new_s)
          if done:
              final = min(final, ans)
              r = mid - 1
          else:
              l = mid + 1
      return final
  
  
  s = input()
  t = input()
  print(solve(s, t))
  
problem_description: Statement
  
  You will be given an integer a and a string s consisting of lowercase English
  letters as input.
  
  Write a program that prints s if a is not less than 3200 and prints `red` if a
  is less than 3200.
samples: [{"input": "3200\n    pink", "output": "pink\n    \n\na = 3200 is not less than 3200, so we print s = `pink`.\n\n* * *"}, {"input": "3199\n    pink", "output": "red\n    \n\na = 3199 is less than 3200, so we print `red`.\n\n* * *"}, {"input": "4049\n    red", "output": "red\n    \n\na = 4049 is not less than 3200, so we print s = `red`."}]