Greedy Strategy: For S[1...n], match S[1] with the first base S[j] that matches (if there is no match, try again on S[2...n]). Then do the same for S[2...j-1] and S[j+1...n], and so on.
Base Pairing Rules: A↔U, C↔G (order doesn't matter)
No Crossing Rule: If bases i and j are paired (i < j), then any other pairs must be either completely inside [i+1, j-1] or completely outside [1, i-1] ∪ [j+1, n].