# https://www.codewars.com/kata/55983863da40caa2c900004e/train/python
# timeout

# from itertools import permutations

# def next_bigger(n):
#     numbers = list(str(n))
#     num_permutations = sorted(set([int(''.join(num)) for num in permutations(numbers, len(numbers))]))
    
#     next_number = num_permutations[num_permutations.index(n)+1]
#     return  next_number if next_number > n else -1
