Add dirty solution for the 18th problem