QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 256 MB Total points: 10

#6026. Word

Statistics

The task is to find the $k$-th (in lexicographical order) non-empty word consisting of at most $n$ letters from the set $\{a, b, c\}$ such that any two adjacent letters in the word are different.

Recall that a word $s$ is smaller than a word $t$ ($s \neq t$) in lexicographical order if $s$ is a prefix of $t$ or if at the first position where $s$ and $t$ differ, the letter in $s$ is smaller (in alphabetical order) than the letter in $t$.

Input

The only line of input contains two integers $n$ and $k$ ($1 \le n \le 10^6$, $1 \le k \le 10^{18}$) as described in the problem.

Output

If there are fewer than $k$ words satisfying the problem conditions, output NIE. Otherwise, the only line of output should contain the requested word.

Examples

Input 1

3 7

Output 1

acb

Input 2

2 10

Output 2

NIE

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.