PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GD0000160. Xây dựng chuỗi ký tự (Construct the String)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Xây dựng chuỗi ký tự (Construct the String)

Construct the String

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

Given positive integers n,a,bn,a,b, construct a lowercase English string ss of length nn in which every contiguous substring of length exactly aa contains exactly bb distinct letters. A solution is guaranteed to exist.

Input

One line contains three integers n,a,bn,a,b in this order.

Output

Print a string of exactly nn lowercase English letters satisfying the condition for every length-aa window.

Subtasks

  • Subtask 1 (20 points): 1≤a≤n≤201\le a\le n\le 20; 1≤b≤min⁡(26,a)1\le b\le\min(26,a).
  • Subtask 2 (30 points): 1≤a≤n≤3001\le a\le n\le 300; 1≤b≤min⁡(26,a)1\le b\le\min(26,a).
  • Subtask 3 (50 points): 1≤a≤n≤20001\le a\le n\le 2000; 1≤b≤min⁡(26,a)1\le b\le\min(26,a).

Examples

Input

7 5 3

Output

abcabca

Explanation

The string abcabca has length 77. Its three length-55 substrings are abcab, bcabc, and cabca, each containing exactly the letters a, b, and c.