#!/usr/bin/env python3
import sys
for arg in sys.argv[1:]:
    courses = arg.split(':')
    id, salary = couses[0], int(courses[1])
    a = salary * 0.835 - 3500
    if a <= 0:
        b = 0
    elif a <= 1500:
        b = a * 0.03
    elif a <= 4500:
        b = a * 0.1 - 105
    elif a <= 9000:
        b = a * 0.2 - 555
    elif a <= 35000:
        b = a * 0.25 - 1005
    elif a <= 55000:
        b = a * 0.3 - 2755
    elif a <= 80000:
        b = a * 0.35 - 5505
    else:
        b = a * 0.45 - 13505
    aftertax_income = salary * 0.835 - b
    print('{}:{:.2f}'.format(id, aftertax_income))
