import re
import sys

class IncRange(object):
    def __init__(self, start, stop=None, step=1):
        if stop is None:
            stop = start
        self.start, self.stop, self.step = int(start), int(stop), int(step)
        self.start_inc, stop_inc = 10 ** len(start), 10 ** len(stop)
        while self.stop < self.start:
            self.stop += stop_inc
    def __iter__(self):
        value = self.start
        while value <= self.stop:
            yield value
            value += self.step
        
def inc_concat(*inc_ranges):
    previous = -1
    for inc_range in inc_ranges:
        for value in inc_range:
            while value < previous:
                value += inc_range.start_inc
            yield value
            previous = value
            
def parse(exp):
    return inc_concat(*list(IncRange(*re.split("-|:|\.\.", exp_)) for exp_ in exp.split(",")))
    
def stringify(it):
    return " ".join(map(str, it))
            
if __name__ == "__main__":
    for line in sys.stdin:
        print(stringify(parse(line.strip())))