logo AlgoBeat OnlineJudge
登录 注册

#216862. [GKS 2022 #C] New Password

内存限制:1024 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

A company named Gooli has issued a new policy that their employees account passwords must contain:

  1. At least characters.
  2. At least one uppercase English alphabet letter.
  3. At least one lowercase English alphabet letter.
  4. At least one digit.
  5. At least one special character. There are special characters: #, @, *, and &.

The company has asked all the employees to change their passwords if the above requirements are not satisfied. Charles, an employee at Gooli, really likes his old password. In case his old password does not satisfy the above requirements, Charles will fix it by appending letters, digits, and special characters. Can you help Charles to find the shortest possible new password that satisfies his company's requirements?

输入格式

The first line of the input gives the number of test cases, . test cases follow. Each test case consists of lines. The first line of each test case contains an integer , denoting the length of the old password. The second line of each test case contains the old password of length . Old password contains only digits, letters, and special characters.

输出格式

For each test case, output one line containing Case #: , where is the test case number (starting from ) and is a valid new password, obtained by possibly fixing the old password in the way that Charles wants and satisfying the company's requirements.

It is guaranteed that at least one solution exists. If there are multiple solutions, you may output any one of them.

样例

样例输入 1

2
7
1234567
10
1111234567

样例输出 1

Case #1: 1234567aA&
Case #2: 1111234567@Rc

样例输入 2

3
1
A
2
1*
7
1234aB&

样例输出 2

Case #1: Aa1*111
Case #2: 1*abAA*
Case #3: 1234aB&

数据范围与提示

In Sample Case #1, the old password does not satisfy requirements , , and . One possible shortest new password is 1234567aA&.

In Sample Case #2, the old password does not satisfy requirements , , and . One possible shortest new password is 1111234567@Rc.

Limits

.

Test Set

.

The old password contains only digits.

Test Set

.

The old password contains only digits, letters, and special characters.