输入样例
5
python
list
set
996
tuple
输出样例
(3, '996')
(3, 'set')
(4, 'list')
(5, 'tuple')
(6, 'python')
#[
# ["单词个数","单词"],
# ["单词个数","单词"],
# ["单词个数","单词"],
# ["单词个数","单词"]
#]
amount = int(input())
#生成一个多维列表
#endList = [[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]
endList = [[0 for row in range(2)] for columb in range(amount)]
for i in range(amount):
endList[i][1] = input()
endList[i][0] = len(endList[i][1])
#根据多个关键字(多个标准)排序
ls = sorted(endList,key= lambda s:(s[0],s[1]))
for i in ls:
print("({}, \'{}\')".format(i[0],i[1]))