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: # Aです
  import sys
  
  input = lambda: sys.stdin.readline().rstrip()
  
  
  def f(x, y):
      left, right = 0, 10**9
      while right - left > 1:
          mid = (left + right) // 2
          if x * mid + mid * (mid - 1) // 2 <= y:
              left = mid
          else:
              right = mid
      return left
  
  
  def f1(x, y):
      left, right = 0, 10**9
      while right - left > 1:
          mid = (left + right) // 2
          if x * mid + mid**2 <= y:
              left = mid
          else:
              right = mid
      return left
  
  
  def f2(x, y):
      left, right = 0, 10**9
      while right - left > 1:
          mid = (left + right) // 2
          if x * mid + mid * (mid + 1) <= y:
              left = mid
          else:
              right = mid
      return left
  
  
  t = int(input())
  for _ in range(t):
      l, r = map(int, input().split())
      if l >= r:
          d = l - r
          ct = f(1, d)
          l -= ct * (ct + 1) // 2
          ct1 = f1(ct, l)
          ct2 = f2(ct, r)
          if ct1 <= ct2:
              ans1 = ct + 2 * ct1
              ans2 = l - ct * ct1 - ct1**2
              ans3 = r - ct * ct1 - ct1 * (ct1 + 1)
          else:
              ans1 = ct + 2 * ct2 + 1
              ans2 = l - ct * (ct2 + 1) - (ct2 + 1) ** 2
              ans3 = r - ct * ct2 - ct2 * (ct2 + 1)
          print(
              "Case #" + str(_ + 1) + ": " + str(ans1) + " " + str(ans2) + " " + str(ans3)
          )
      else:
          d = r - l
          ct = f(1, d)
          r -= ct * (ct + 1) // 2
          if l == r:
              ct1 = f1(ct, l)
              ct2 = f2(ct, r)
              if ct1 <= ct2:
                  ans1 = ct + 2 * ct1
                  ans2 = l - ct * ct1 - ct1**2
                  ans3 = r - ct * ct1 - ct1 * (ct1 + 1)
              else:
                  ans1 = ct + 2 * ct2 + 1
                  ans2 = l - ct * (ct2 + 1) - (ct2 + 1) ** 2
                  ans3 = r - ct * ct2 - ct2 * (ct2 + 1)
              print(
                  "Case #"
                  + str(_ + 1)
                  + ": "
                  + str(ans1)
                  + " "
                  + str(ans2)
                  + " "
                  + str(ans3)
              )
  
          else:
              ct1 = f1(ct, r)
              ct2 = f2(ct, l)
              if ct1 <= ct2:
                  ans1 = ct + 2 * ct1
                  ans3 = r - ct * ct1 - ct1**2
                  ans2 = l - ct * ct1 - ct1 * (ct1 + 1)
              else:
                  ans1 = ct + 2 * ct2 + 1
                  ans3 = r - ct * (ct2 + 1) - (ct2 + 1) ** 2
                  ans2 = l - ct * ct2 - ct2 * (ct2 + 1)
              print(
                  "Case #"
                  + str(_ + 1)
                  + ": "
                  + str(ans1)
                  + " "
                  + str(ans2)
                  + " "
                  + str(ans3)
              )
  
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"}]