# data[].attributes.attachment_link.readable_text
T = ()

r = int(input("Enter number of rows: "))
c = int(input("Enter number of columns: "))

print()

for i in range(r):
    T1 = ()
    for j in range(c):
        ele = int(input("Enter element: "))
        T1 += (ele, )
    T += ((T1), )

print()

print("Created matrix: ")

for i in range(r):
    for j in range(c):
        print(T[i][j], end = " ")
    print()

print()

print("Right diagonal of matrix: ")

for i in range(r):
    for j in range(c):
        if i+j == c-1:
            print(T[i][j])

# data[].attributes.attachment_link.readable_text
Football = {}

n = int(input("Enter number of players: "))

print()

for i in range(n):
    name = input("Enter name of the player: ")
    score = int(input("Enter score of player: "))
    Football.update({name:score})

print()

print("Dictionary of players and score: ")

print(Football)

print()

while True:
    print("1: Add new player")
    print("2: Delete a player")
    print("3: Change score of a player")
    print("4: Check presence of a player")
    print("5: Display players in alphabetical order")
    print("6: Exit")

    print()

    opt = int(input("Enter your option:   "))

    print()

    if opt == 1:
        name = input("Enter name of the player: ")
        if name in Football:
            print("Player already exists. Enter a new player's name")
        else:
            score = int(input("Enter score of player: "))
            Football.update({name:score})
        print()

    elif opt == 2:
        name = input("Enter name of the player: ")
        if name in Football:
            del Football[name]
        else:
            print("Player not found. Enter name of existing player")
        print()

    elif opt == 3:
        name = input("Enter name of the player: ")
        if name in Football:
            score = int(input("Enter score of player: "))
            Football.update({name:score})
        else:
            print("Player not found. Enter name of existing player")
        print()

    elif opt == 4:
        name = input("Enter name of the player: ")
        if name in Football:
            print("Player is present")
        else:
            print("Player is not present")
        print()

    elif opt == 5:
        print(dict(sorted(Football.items())))
        print()

    elif opt == 6:
        break
    
    else:
        print("Error: Enter correct option")
        print()
