Its the console version of greedy-search