next_permutation() does not work?!
Julka_jul you should not print anything while reading input. just keep it as int(input())