Graceful Triangles
시간 제한2초메모리 제한1024 MB
거리가 2 이하인 모든 쌍을 연결한 그래프의 n+2개 정점에 값을 부여해 2n+1개 간선의 차이가 정확히 1부터 2n+1이 되도록 한다.
문제
Consider the following graph in the shape of equilateral triangles stitched together horizontally:

This graph has vertices and edges. The vertices are labeled in the order of increasing horizontal position, as in the image above.
In other words, the graph has vertices labeled from through , and edges connecting all pairs of vertices whose labels differ by at most .
A positive integer value is assigned to each vertex. Vertex has the value of . The value of an edge that connects vertices and is . Find a way to assign values to all vertices so that for every positive integer up to inclusive, exactly one edge has the value of . The value of any vertex cannot exceed .
입력
The first line contains , a positive integer.
출력
If a solution exists for the given , print the values assigned to the vertices in one line, separated by spaces. The values must be positive integers not exceeding . Otherwise, print .