#K9246. Unique Substrings
Unique Substrings
Unique Substrings
Given a string \(s\), generate all unique substrings of \(s\) and print them in lexicographic order.
Recall that the total number of substrings of a string of length \(n\) is given by \(\frac{n(n+1)}{2}\), but duplicate substrings should only be included once. Each substring must be printed on a new line.
This problem tests your ability to work with strings and sets, ensuring that you correctly generate, de-duplicate, and sort all substrings of a given string.
inputFormat
The input consists of a single line containing the string \(s\). The string is non-empty and contains only lowercase English letters.
outputFormat
Output all unique substrings of \(s\) in lexicographic order, each printed on a separate line.
## sampleabc
a
ab
abc
b
bc
c
</p>