#有序情况下重命名为相同字符长度:1,2,9,19,102→001,002,009,019,102
import os
path=input('')
filelist=os.listdir(path)
for file in filelist:
filetype=os.path.splitext(file)[1]
if filetype=='.ts':
filename=os.path.splitext(file)[0]
name_width=filename.zfill(3)
oldname=os.path.join(path,file)
newname=os.path.join(path,name_width+filetype)
os.rename(oldname,newname)
print(oldname,'....',newname)