------
## 最终结论
```python
def frequency_sort(s):
    # Step 1: Count the frequency of each character in the string
    freq = {}
    for char in s:
        if char in freq:
            freq[char] += 1
        else:
            freq[char] = 1

    # Step 2: Sort characters by frequency (descending) and then by character (ascending)
    sorted_chars = sorted(freq.items(), key=lambda item: (-item[1], item[0]))

    # Step 3: Generate the result string based on sorted characters
    result = []
    for char, count in sorted_chars:
        result.append(char * count)

    return ''.join(result)

# Example usage:
print(frequency_sort("tree"))   # Output: "eert"
print(frequency_sort("cccaaa")) # Output: "cccaaa" or "aaaccc"
print(frequency_sort("Aabb"))   # Output: "bbAa" or "bbaA"
```