Time Limit: 2 sec / Memory Limit: 1024 MB
NNXXA_1A1A_2A2\cdots⋯A_NAN
4 2
3 1 1 2
3
Takahashi's secret will be learned by Friend 11, Friend 22, and Friend 33, as follows.
In the end, three of his friends learn the secret, so we print 33.