Find the next permutation in lex order
a) 1342 -> 1423 b) 45321 -> 51234 c) 13245 -> 13254 d) 612345 -> 612354 e) 1623547 -> 1223574 f) 23587416 -> 23587461