프로그램 명: boi_mag
제한시간: 1 초

Famous stones Xi-n-k can only be found in Wonderland. Such a stone is simply a granite board with an inscription consisting only of letters X and I. Each board contains exactly n letters. There are not more than k positions in each board where letters X and I are next to each other. The top and bottom sides of the stones are not fixed, so the stones can be rotated upside-down. For instance two figures below depict exactly the same stone:

IXXIIXXX
XXXIIXXI
Fig. 1: Two ways of looking at the same stone. This stone is of type Xi-8 -3 , but also Xi-8 -4 (and also of any type Xi-8 -k for k > 3 ).

No two magic stones in Wonderland are the same, i.e. no two stones contain the same inscription (remember that the upside-down rotation of a stone is allowed).

If it is possible to read the inscription of some stone in two difierent ways (using the upside-down rotation) then the canonical representation of the stone is defined as the lexicographically less of these two ways of reading the inscription. ...We say that inscription A is lexicographically less than B (assuming that lengths of A and B are the same) if A contains letter I and B contains letter X at the first position where the inscriptions differ.

If a stone’s inscription is symmetrical, i.e. the upside-down rotation does not change it, then its canonical representation is defined as the unique way of reading this inscription.

Example: There are exactly 6 stones of type Xi-3-2. Their canonical representations written in lexicographical order are: III, IIX, IXI, IXX, XIX and XXX.

Alice is a well-known expert on the Xi-n-k stones from Wonderland. She would like to create a lexicographical index of the canonical representations of all stones of type Xi-n-k (for some specific values of n and k). What inscription should be written at position i of the index, for a given value of i?

Task

Write a programme which:

입력

The first and only line of the standard input contains three integers n, k and i (0 <= k < n <= 60, 0 < i < 10^18) separated by single spaces.

출력

The first and only line of the standard output should contain the i-th (in the lexicographical order) canonical representation of a Xi-n-k stone.

If the number of Xi-n-k stones is less than i then the first and only line of output should contain expression NO SUCH STONE.

입출력 예

입력

3 2 5

출력

XIX

입력

3 2 7

출력

NO SUCH STONE
출처:BOI 2008 7/7

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]