Prints first 'n' numbers in lexicographical order