Ticket 3026

Logs
Input
9
7
)(())()
9
(((()))()
6
)()(((
7
))(()))
3
(()
6
))))))
1
(
9
()()))())
4
(())

Expected Output
2 0
4 0
2 1
3 1
1 1
3 0
0 1
4 1
2 0

Update Logs

Note: You can also use F5 to update the logs. This would also retain cursor position while scrolling.