Help me in solving SKMP problem

My issue

How to find ascii index of first character of string

My code

# cook your dish here
for _ in range(int(input())):
    s=input()
    p=input()
    sorted_string = ''.join(sorted(s))
    print(sorted_string)
    
    

Problem Link: SKMP Problem - CodeChef

In python the ord() function takes in a character and returns the ASCII value of that character.

For example -
ord(‘p’) returns 112 (of type integer).
To get the ASCII index of the first character of the string, ord(s1[0]) can be used where s1 resembles the variable.

Additionally, if you want to compare two strings lexicographically, you can directly use the logical operators.

For example - ‘a’ < ‘b’, returns True
while ‘c’ > ‘f’ returns False