Files
CodeObject/zeta/py/completed/1431.py
2025-05-07 04:44:30 +09:00

9 lines
169 B
Python

N = int(input())
def c(v):
return sum([int(i) for i in v if i.isdigit()])
for c in sorted([input() for i in range(N)], key=lambda v: (len(v), c(v), v)):print(c)