m = float(input())
if m >= 5000:
m *= 0.6
elif m >= 2000:
m *= 0.7
elif m >= 500:
m *= 0.8
elif m >= 100:
m *= 0.9
print("%.1f" % m)
m = float(input())
if m >= 5000:
m *= 0.6
elif m >= 2000:
m *= 0.7
elif m >= 500:
m *= 0.8
elif m >= 100:
m *= 0.9
print("%.1f" % m)