Problem Statement-
Monocarp had a sequence consisting of integers . He painted the elements into two colors, red and blue; elements were painted red, all other elements were painted blue.
After painting the elements, he has written two sequences and . The sequence consisted of all red elements of in the order they appeared in ; similarly, the sequence consisted of all blue elements of in the order th