#!/usr/bin/env python3
from os import listdir
from os.path import isdir
from sys import argv, exit

if len(argv) == 1:
    argv.append('.')

exts = set()
for dirname in argv[1:]:
    for filename in listdir(dirname):
        if isdir(filename):
            continue
        if not '.' in filename:
            continue
        ext = filename.split('.')[-1]
        if ext in exts:
            continue
        exts.add(ext)
        print(ext)
