Messy

medium
<a href="https://codeforces.com/problemset/problem/1227/C">https://codeforces.com/problemset/problem/1227/C</a>

Input Format

.

Output Format

.

Constraints

.

Notice

.

Example

Input
4
8 2
()(())()
10 3
))()()()((
2 1
()
2 1
)(
Output
4
3 4
1 1
5 8
2 2
3
4 10
1 4
6 7
0
1
1 2
Previous
Marina And Vasya
Next
Cows And Sequences

Related Questions