CF110B.Lucky String

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 2626 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: 22
  • c: 3,103,10
  • d: 4,84,8
  • e: 66
  • f: 77
  • z: 1,5,91,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: 51=45-1=4 , 95=49-5=4 , for letters c: 103=710-3=7 , for letters d: 84=48-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 nn .

输入格式

The single line contains a positive integer nn ( 1<=n<=1051<=n<=10^{5} ) — the length of the sought string.

输出格式

Print on the single line the lexicographically minimal lucky string whose length equals nn .

输入输出样例

  • 输入#1

    5
    

    输出#1

    abcda
    
  • 输入#2

    3
    

    输出#2

    abc
    

说明/提示

The lexical comparison of strings is performed by the < operator in modern programming languages. String aa is lexicographically less than string bb if exists such ii ( 1<=i<=n1<=i<=n ), that a_{i}<b_{i} , and for any jj ( 1<=j<i ) aj=bja_{j}=b_{j} .

首页