TTC2014 solution