Codeforces Beta Round 84 (Div. 2 Only)
B
Lucky String
Codeforces
1100
原题
← AC →
翻译中…

Petya loves lucky numbers. We all know that lucky numbers are the positive integers whose decimal representations contain only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not.

翻译中…

Petya recently learned to determine whether a string of lowercase Latin letters is lucky. For each individual letter all its positions in the string are written out in the increasing order. This results in $26$ lists of numbers; some of them can be empty. A string is considered lucky if and only if in each list the absolute difference of any two adjacent numbers is a lucky number.

翻译中…

For example, let's consider string "zbcdzefdzc". The lists of positions of equal letters are:

翻译中…
  • b: $2$
  • c: $3, 10$
  • d: $4, 8$
  • e: $6$
  • f: $7$
  • z: $1, 5, 9$
  • Lists of positions of letters a, g, h, ..., y are empty.
翻译中…

This string is lucky as all differences are lucky numbers. For letters z: $5 - 1 = 4$, $9 - 5 = 4$, for letters c: $10 - 3 = 7$, for letters d: $8 - 4 = 4$.

翻译中…

Note that if some letter occurs only once in a string, it doesn't influence the string's luckiness after building the lists of positions of equal letters. The string where all the letters are distinct is considered lucky.

翻译中…

Find the lexicographically minimal lucky string whose length equals $*n*$.

翻译中…

Input

翻译中…

The single line contains a positive integer $*n*$ ($1 ≤ *n* ≤ 10^{5}$) — the length of the sought string.

翻译中…

Output

翻译中…

Print on the single line the lexicographically minimal lucky string whose length equals $*n*$.

翻译中…

Note

翻译中…

The lexical comparison of strings is performed by the < operator in modern programming languages. String $*a*$ is lexicographically less than string $*b*$ if exists such $*i*$ ($1 ≤ *i* ≤ *n*$), that $*a*_{*i*} < *b*_{*i*}$, and for any $*j*$ ($1 ≤ *j* < *i*$) $*a*_{*j*} = *b*_{*j*}$.

翻译中…

样例

Input #1
5
Output #1
abcda
InputCopy OutputCopy
Input #2
3
Output #2
abc
InputCopy OutputCopy
题目信息
题号
110B
时间限制
2 s
内存限制
256 MB
标签
构造
字符串

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。