Print the names of the teams in increasing order of their rankings

  def RankTeams(arr):          for i in range(len(arr)):                        if(arr[i][0] == arr[i][1]):            print(“Invalid”)            return                            arr[i][2] = int(arr[i][2])        arr[i][3] = int(arr[i][3])          table = {}              for i in range(len(arr)):                                li1 = [0] * 4                                  li2 = [0] * 4                  if arr[i][0] in table:            li1 = table[arr[i][0]]                              if arr[i][1] in table:            li2 = table[arr[i][1]]                  li1[2] += arr[i][2]                          li1[3] += arr[i][3]                  li2[2] += arr[i][3]                          li2[3] += arr[i][2]                  li1[1] = li1[2] – li1[3]        li2[1] = li2[2] – li2[3]                  if(arr[i][2] == arr[i][3]):            li1[0] += 1            li2[0] += 1                  elif(arr[i][2] > arr[i][3]):            li1[0] += 2                  elif(arr[i][2] < arr[i][3]):            li2[0] += 2                  table[arr[i][0]] = li1        table[arr[i][1]] = li2          for key, value in sorted(table.items(),                             key = lambda r: (-r[1][0],                                            -r[1][1],                                            -r[1][2],                                            r[0])):                print(key, end ='n')      arr = [['Spain', 'England', '3', '0'],        ['England', 'France', '1', '1'],       ['Spain', 'France', '0', '2']]  RankTeams(arr)