And no one makes me close my eyes
$$$~\\$$$
Deep in the Arctic permafrost lies an obsidian monolith etched with glowing celestial runes. These symbols — said to hold the fabric of spacetime — shift positions during auroral storms. Ancient texts warn that if the runes ever freeze in a "disordered sequence," two must be swapped exactly once to restore cosmic balance. Any additional tampering would collapse reality into quantum limbo.
When Vistar discovers the monolith frozen as a sequence, its hum resonates with impending doom. The decoded notes reveal: "One swap averts the rupture. Two swaps lead to chaos."
Now, as the ground trembles, he must answer: Are the runes already ordered by fate's design? If not, do exactly two exist whose swap would align them?
More formally, given $$$n$$$ numbers, please determine:
The first line contains a single integer $$$n$$$ $$$(1\le n\le 1000)$$$ — the number of runes.
The second line contains an array $$$a$$$ of length $$$n$$$ $$$(1 \le a_i\le 10^9)$$$.
If the runes are already in or can be restored in ascending order, output "Sorted". Otherwise, output "Failed".
51 4 3 2 5
Sorted
44 4 2 1
Failed