Under construction

Still being built. Things may change

Password Generator

Interview

Time limit2sMemory limit512 MB

Summary
Build any length-n string of letters and digits meeting minimum counts of uppercase, lowercase, and digit characters, with no two equal adjacent characters.
Level

Medium4 of 10

Topics
Greedy, Implementation, String, Math
Solved
No attempts yet

Problem

After a series of leaks of confidential information, the public began to think seriously about which passwords to use. For example, the password <<11111>> is simple and should not be used. But how do you tell whether a password is good?

The Business Process Standardization Foundation conducted a study showing that a good password must be long enough and contain characters of different kinds. The study showed that a good password must have exactly nn characters. The password must consist of uppercase and lowercase Latin letters and digits, and satisfy the following requirements:

  • the password must contain at least aa uppercase letters;
  • the password must contain at least bb lowercase letters;
  • the password must contain at least cc digits;
  • the password must not contain two identical consecutive characters.

Realizing that users would find it uncomfortable to invent a password satisfying all these requirements, the Foundation's staff decided to write a program to help users with this task.

Help the Foundation: write a program that, given the parameters, generates a suitable password.

Input

The first line of the input contains the integer nn, the required password length (1≤n≤1001 \le n \le 100). The second line contains the non-negative integers aa, bb and cc, the minimum required number of uppercase letters, lowercase letters and digits, respectively (a+b+c≤na + b + c \le n).

Output

In a single line, output any good password. Only uppercase and lowercase Latin letters and digits may be used.

Examples1

  1. Example 1

    Input
    8
    2 5 1
    
    Expected output
    PasSw0rd