#!/usr/bin/env python import sys import empty def add_delim(s): s = s[ :: -1 ] d = '' while len( s ) > 3: d += s[ :3 ] + ',' s = s [ 3: ] d += s return d[ :: -1 ] def cnv(s): e = empty.new( s='', buf='' ) def cut_spc(n): for i in range( n ): if e.s[ -2 : ] == ' ': e.s = e.s[ : -1 ] def conn(): if e.buf: buf = add_delim( e.buf ) cut_spc( buf.count( ',' ) ) e.s += buf e.buf = '' for c in s: if c.isdigit(): e.buf += c else: conn() e.s += c conn() return e.s if __name__ == "__main__": s = sys.stdin.read() d = cnv( s ) sys.stdout.write( d ) # EOF