• 思路:找规律。需要注意的是,输出值为位置而不是索引值,当n-2=4的整数倍时,n=a[0-1]=4
n = int(input())
a = [2, 3, 2, 4]
if n < 3:
    print(-1)
else:
    print(a[((n-2) % 4)-1])