运用正则表达式

import re
while True:
    try:
        print(re.sub('(\d+)', '*\g<1>*', input()))
    except:
        break