output_description: Print the kyu M-kun has, as an integer. For example, if he has 8-kyu, print
  `8`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      X
attempt: N = int(input())
  X = [None] * N
  Y = [None] * N
  U = [None] * N
  for i in range(N):
      X[i], Y[i], U[i] = input().split()
  
  
  def main():
      for i in range(N):
          for j in range(N):
              if i > j:
                  continue
  
              if U[i] == U[j]:
                  continue
  
              """
        U vs R ... Ux > Rx and Ux - Rx == Ry - Uy
        U vs D ... Ux == Dx and Uy < Dy and (Uy - Dy) % 2 == 0 # Note: if Uy = 3, Dy = 0, conflict does NOT happen
        U vs L ... Uy > Ly and Uy - Ly == Lx - Ux
        """
              if U[i] == "U" and U[j] == "R":
                  if int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(
                      Y[i]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(Y[j]) - int(Y[i])) * 10)
  
              if U[i] == "U" and U[j] == "D":
                  if (
                      (int(X[i]) == int(X[j]))
                      and (int(Y[i]) < int(Y[j]))
                      and (int(Y[i]) - int(Y[j])) % 2 == 0
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(Y[i]) - int(Y[j])) * 5)
  
              if U[i] == "U" and U[j] == "L":
                  if int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(
                      X[i]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(Y[i]) - int(Y[j])) * 10)
  
              """
        R vs U ... Ry > Uy and Ry - Uy == Ux - Rx
        R vs D ... Dx > Rx and Dx - Rx == Dy - Ry
        R vs L ... Ry == Ly and Rx < Lx and (Rx - Lx) % 2 == 0
        """
              if U[i] == "R" and U[j] == "U":
                  if int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(
                      X[i]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(X[j]) - int(X[i])) * 10)
  
              if U[i] == "R" and U[j] == "D":
                  if int(X[j]) > int(X[i]) and int(X[j]) - int(X[i]) == int(Y[j]) - int(
                      Y[i]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(X[j]) - int(X[i])) * 10)
  
              if U[i] == "R" and U[j] == "L":
                  if (
                      (int(Y[i]) == int(Y[j]))
                      and (int(X[i]) < int(X[j]))
                      and (int(X[i]) - int(X[j])) % 2 == 0
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(X[i]) - int(X[j])) * 5)
  
              """
        D vs U ... Dx == Ux and Dy > Uy and (Dy - Uy) % 2 == 0
        D vs R ... Dy > Ry and Dy - Ry == Dx - Rx
        D vs L ... Dy > Ly and Dy - Ly == Lx - Dx
        """
              if U[i] == "D" and U[j] == "U":
                  if (
                      (int(X[i]) == int(X[j]))
                      and (int(Y[i]) > int(Y[j]))
                      and (int(Y[i]) - int(Y[j])) % 2 == 0
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(Y[i]) - int(Y[j])) * 5)
  
              if U[i] == "D" and U[j] == "R":
                  if int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[i]) - int(
                      X[j]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(Y[i]) - int(Y[j])) * 10)
  
              if U[i] == "D" and U[j] == "L":
                  if int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(
                      X[i]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(Y[i]) - int(Y[j])) * 10)
  
              """
        L vs U ... Lx > Ux and Lx - Ux == Ly - Uy
        L vs D ... Lx > Dx and Lx - Dx == Dy - Ly
        L vs R ... Ly == Ry and Lx > Rx and (Rx - Lx) % 2 == 0
        """
              if U[i] == "L" and U[j] == "U":
                  if int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[i]) - int(
                      Y[j]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(X[i]) - int(X[j])) * 10)
  
              if U[i] == "L" and U[j] == "D":
                  if int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(
                      Y[i]
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(X[i]) - int(X[j])) * 10)
  
              if U[i] == "L" and U[j] == "R":
                  if (
                      (int(Y[i]) == int(Y[j]))
                      and (int(X[i]) > int(X[j]))
                      and (int(X[j]) - int(X[i])) % 2 == 0
                  ):
                      # print('{} {}'.format(U[i], U[j]))
                      return abs((int(X[j]) - int(X[i])) * 5)
  
      return "SAFE"
  
  
  print(main())
  
problem_description: Statement
  
  M-kun is a competitor in AtCoder, whose highest rating is X.  
  In this site, a competitor is given a _kyu_ (class) according to his/her
  highest rating. For ratings from 400 through 1999, the following kyus are
  given:
  
    * From 400 through 599: 8-kyu
    * From 600 through 799: 7-kyu
    * From 800 through 999: 6-kyu
    * From 1000 through 1199: 5-kyu
    * From 1200 through 1399: 4-kyu
    * From 1400 through 1599: 3-kyu
    * From 1600 through 1799: 2-kyu
    * From 1800 through 1999: 1-kyu
  
  What kyu does M-kun have?
samples: [{"input": "725", "output": "7\n    \n\nM-kun's highest rating is 725, which corresponds to 7-kyu.  \nThus, `7` is the correct output.\n\n* * *"}, {"input": "1600", "output": "2\n    \n\nM-kun's highest rating is 1600, which corresponds to 2-kyu.  \nThus, `2` is the correct output."}]