Add template for greedy.