output_description: Print "Yes" if given dices are all different, otherwise "No" in a line.
input_description: In the first line, the number of dices $n$ is given. In the following $n$
  lines, six integers assigned to the dice faces are given respectively in the
  same way as Dice III.
attempt: number = int(input())
  dices = []
  for i in range(number):
      dices.append(input().split())
  
  tf = 0
  for i in range(number - 1):
      for j in range(i + 1, number):
  
          dice_1 = dices[i]
          dice_2 = dices[j]
          rolls = {
              " ": [0, 1, 2, 3, 4, 5],
              "W": [2, 1, 5, 0, 4, 3],
              "N": [1, 5, 2, 3, 0, 4],
              "E": [3, 1, 0, 5, 4, 2],
              "S": [4, 0, 2, 3, 5, 1],
          }
          orders = [" ", "N", "W", "E", "S", "NN"]
          for order in orders:
              copy_2 = dice_2
              for d in order:
                  roll = rolls[d]
                  copy_2 = [copy_2[i] for i in roll]
              l = [1, 2, 4, 3]
              a0 = copy_2[0] == dice_1[0]
              a1 = copy_2[5] == dice_1[5]
              a2 = " ".join([copy_2[s] for s in l]) in " ".join(
                  [dice_1[s] for s in l] * 2
              )
              if a0 and a1 and a2:
                  tf += 1
  if tf > 0:
      print("No")
  else:
      print("Yes")
  
problem_description: Dice IV
  
    
  
  Write a program which reads $n$ dices constructed in the same way as Dice I,
  and determines whether they are all different. For the determination, use the
  same way as Dice III.
samples: [{"input": "3\n    1 2 3 4 5 6\n    6 2 4 3 5 1\n    6 5 4 3 2 1", "output": "No"}, {"input": "3\n    1 2 3 4 5 6\n    6 5 4 3 2 1\n    5 4 3 2 1 6", "output": "Yes"}]