output_description: If the wolves will attack the sheep, print `unsafe`; otherwise, print `safe`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      S W
attempt: s = input()
  n = len(s)
  if n < 4:
      quit()
  l, r = 0, 4
  ans = [[[], []] for _ in range(n + 3)]
  for i in range(4, 8):
      l = 0
      while l + i <= n:
          if int(s[l : (l + i)]) % 2019 == 0:
              ans[l + 1][0].append(l + i)
              ans[l + i + 1][1].append(l + 1)
          l += 1
  final = 0
  cnt = 1
  for i in range(n + 1):
      if ans[i][0] and ans[i][1]:
          cnt += 1
          final += cnt
      elif ans[i][0]:
          final += 1
          cnt = 1
  print(final)
  
problem_description: Statement
  
  There are S sheep and W wolves.
  
  If the number of wolves is greater than or equal to that of sheep, the wolves
  will attack the sheep.
  
  If the wolves will attack the sheep, print `unsafe`; otherwise, print `safe`.
samples: [{"input": "4 5", "output": "unsafe\n    \n\nThere are four sheep and five wolves. The number of wolves is not less than\nthat of sheep, so they will attack them.\n\n* * *"}, {"input": "100 2", "output": "safe\n    \n\nMany a sheep drive away two wolves.\n\n* * *"}, {"input": "10 10", "output": "unsafe"}]