D - Dragonslayers

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

Input

Output

Sample test(s)

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