You are given a string s that has lowercase English characters. You are also given an integer n. You need to generate a string x of the given length n such that:
- All of the distinct characters present in s must be present in the string x.
- We will then make a string t by repeatedly adding the string x to it until the string t can be rearranged to have the string s as a substring.
- The generated string t should be of the minimum possible length.
- If there are multiple possible t with the same length, the string x should be chosen so that the generated string t is the lexicographically smallest possible.
Return the string x that would generate the string t. Return empty string if no such string x exists.