Returning MIME types according to input filenames' extensions
You should use a list rather than a dictionary for fileNames or extensions.
You don't get any benefit for using a dictionary,
and actually makes the code slightly harder to use.
You should utilize a dictionary's \$O(1)\$ key lookup, rather than re-implement an \$O(n)\$ look up.
This is as if extensions[fileIndex] in MIMETable is already fast.
Utilize dictionary functions such as get(key, default).
You don't need three separate loops, as they are all just different sections of transforming from a file name to a MIME type.
It would also be easier to read it without the loops too.
You should follow PEP8, this means your names should be MIME_table rather than MIMEtable.
Also MIME_table looks odd, so I'd change it to mime_table.
You don't need math or sys, and so I'd remove them.
Your comments are left overs to debugging,
instead of commenting out prints when you're debugging,
I'd recommend that you use Pythons logging library.


Without merging the loops together, you can change your code to:

amount_mime_types = int(input())
amount_file_names = int(input())
mime_table = {}
for i in range(amount_mime_types):
    ext, mt = input().split()
    mime_table[ext.lower()] = mt

file_names = []
for _ in range(amount_file_names):
    file_names.append(input())

extensions = []
for name in file_names:
    if '.' in name:
        extensions.append(name.split('.')[-1].lower())
    else:
        extensions.append('unknown')

mime_types = []
for extension in extensions:
    mime_types.append(mime_table.get(extension, 'UNKNOWN'))

print('\n'.join(mime_types))


Where if you join the file_names, extensions and mime_types loops together you get:

amount_mime_types = int(input())
amount_file_names = int(input())
mime_table = {}
for i in range(amount_mime_types):
    ext, mt = input().split()
    mime_table[ext.lower()] = mt

mime_types = []
for _ in range(amount_file_names):
    name = input()
    if '.' in name:
        extension = name.split('.')[-1].lower()
    else:
        extension = 'unknown'
    mime_type = mime_table.get(extension, 'UNKNOWN')
    mime_types.append(mime_type)

print('\n'.join(mime_types))


There are still a couple ways to improve this:


You can write all this in a function.
This also improves the speed of the program.
Pre-define mime_types to an 'array' of None. mime_types = [None] * amount_file_names.
This is as lists sometimes have to move and is more a 'just in case' optimisation.