import sys

def split_any(txt, seps):
	seps = iter(seps)
	default_sep = next(seps)	
	for sep in seps:
		txt = txt.replace(sep, default_sep)
	return txt.split(default_sep)

def inc_range(init, start, end=None, step=1):
	np10_start = 10**len(start)
	start = int(start)
	
	init_lower = init % np10_start
	init_upper = init - init_lower
	init = init_upper + start
	if init_lower >= start:
		init += np10_start
	yield init
	
	if end != None:
		np10_end = 10**len(end)
		end, step = int(end), int(step)
		while True:
			init += step
			yield init
			if init % np10_end == end:
				break

seps = ['-', ':', '..']
for line in sys.stdin:
	line, count, output = line.strip(), 0, []
	for item in line.split(','):
		for i in inc_range(count, *split_any(item, seps)):
			output.append(str(i))
		count = i
	print(' '.join(output))