Words are being printed correctly, and the cost to be print is calculated. Need to minimize the cost.