#!/usr/bin/env python

import sys

if __name__ == '__main__':
    indices = sys.argv[1:]
    indices = ' '.join(indices).replace(',', ' ')

    for token in indices.split():
        try:
            index_from = int(token)
        except ValueError:
            index_from, index_to = map(int, token.split('-'))
        else:
            index_to = index_from

        for index in range(index_from, index_to + 1):
            print(index)
