A train is good if the following conditions are met.
- Number of words in the name should be greater than 1 and last word must be "Mail" or "Express".
- Average speed should be greater than 70 kmph.
- Total journey distance should be greater than 700km.
- (Total distance)/(no. of stations) should be greater than 50 if the train is "Mail". If it is an "Express" train, this ratio must be atleast 100.
- Passenger should be happy.
- There should be a "3AC" Coach if the distance is greater than 1000 km. Additionally, it must also have a "2AC" coach if the distance is more than 1500 km.