sorting subsets of set

Input are the sets S1, S2, . . . , Sl , where l ≤ n. Each of these sets have integers in the range (0, nc − 1) for a fixed c. Also let Pl j=1 |Sj | = n. The goal is to output S1 in sorted order, then S2 in sorted order, and so on. Design an O(n)-time algorithm for this problem.