ABC Legacy

아직 제출이 없습니다시간 제한1초메모리 제한1024 MB

문제

You are given a string $S$ of length $2n$, consisting of the characters A, B and C. Determine if $S$ can be split into $n$ non-intersecting subsequences, each of which forms one of the strings "AB", "AC", "BC". If it is possible, find such a splitting.

입력

The first line of input contains one integer $n$ ($1 \le n \le 10^5$).

The second line of input contains a string $S$ of length $2n$, consisting of the characters A, B and C.

출력

If the splitting is not possible, print "NO" (without quotes).

If the splitting is possible, print "YES" (without quotes), followed by $n$ lines, each describing two indices for the $i$-th subsequence ($1 \le l_i < r_i \le 2n$).