Print B distinct words formed by mapping the decimal digits of 0 to B-1 to letters a to j.
Easy1ImplementationStringNo attempts yetTime limit1sMemory limit64 MBFinal exams are close, and every high school senior has to write one essay in their native language. Mirko believes that this year a computer grades the essays instead of a person.
So Mirko decided to write an essay that does not have to make any sense, as long as it passes the machine check. An essay passes the check when all of the following hold.
The essay is written on one line and uses only lowercase English letters and spaces. It carries no punctuation such as periods or commas, and its words do not have to be real English words.
Many essays satisfy the conditions, so exactly one output is accepted as correct. The output section gives the rule.
The first and only line contains the integers A and B, separated by one space. (1≤A≤B≤100000)
Print B words on one line, separated by one space each.
Build the i-th word like this. Write i−1 in decimal without leading zeros, then replace the digits 0, 1, 2, ..., 9 with the letters a, b, c, ..., j. For example, i=1 gives a, i=10 gives j, and i=11 gives ba.
This essay has B words and they are all different, so it satisfies every condition above.