You are given a string S. Your task is to print all possible combinations, up to size k, of the string in lexicographic sorted order.