A permutation *p* of size *n* is the sequence *p*<sub class="lower-index">1</sub>, *p*<sub class="lower-index">2</sub>, ..., *p*<sub class="lower-index">*n*</sub>, consisting of *n* distinct integers, each of them is from 1 to *n* (1 ≤ *p*<sub class="lower-index">*i*</sub> ≤ *n*).

A lucky permutation is such permutation *p*, that any integer *i* (1 ≤ *i* ≤ *n*) meets this condition *p*<sub class="lower-index">*p*<sub class="lower-index">*i*</sub></sub> = *n* - *i* + 1.

You have integer *n*. Find some lucky permutation *p* of size *n*.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the required permutation size.
from itertools import permutations
from sys import stdin


def checkit(vector, upto=-1):
    if upto == -1:
        upto = len(vector)
    for i in range(0, upto):
        if vector[vector[i] - 1] != len(vector) - (i + 1) + 1:
            return False
    return True


def calculate(n):
    numbers = list(range(1, n + 1))
    result = [0] * n
    for i in range(0, n):
        if result[i] != 0: continue
        if i > 0 and checkit(result, i): continue

        expected = n - i
        for v in numbers:
            res = result[:]
            res[i] = v
            if res[res[i] - 1] == expected:
                numbers.remove(res[i])
                result = res
                break
            elif res[res[i] - 1] == 0:
                assert expected in numbers
                res[res[i] - 1] = expected
                numbers.remove(res[i])
                numbers.remove(expected)
                result = res
                break

    return result


if __name__ == "__main__":
    try:
        number = int(stdin.readline())
        result = calculate(number)
        assert checkit(result)
        print(" ".join([str(v) for v in result]))
    except ValueError:  # no solution
        print(-1)
