G - Gotcha Station

Languages: C, C++, Java, Python, Kotlin
Time & Memory limits: (details)

Input

Output

Sample test(s)

Input
2 5 6 1 5 1 2 2 3 1 3 3 4 4 5 3 5 4 4 1 3 1 2 2 3 3 4 1 4
--- Showing first 30 lines (click "Copy" to get full content) ---
Output
3 1 3 5 2 1 3
--- Showing first 30 lines (click "Copy" to get full content) ---