logo AlgoBeat OnlineJudge
登录 注册

#216587. [ICPC 2026 LAC] GATA-CAT

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

题目描述

A DNA sequence is a molecular chain composed of the four nucleobases: cytosine (C), guanine (G), adenine (A), and thymine (T). Those letters can be used to encode a genetic sequence as text.

Previously, we hypothesized that felines owe their traits to what we call their CAT degree. It’s the number of times that their genetic sequence contains the nucleobases C-A-T in that order, ignoring other nucleobases between them. For instance, the sequences “GACT”, “GCAT”, and “CCGAAGT” have CAT degrees , , and , respectively.

It turns out that was only half the picture. Researchers from Latin America were surprised to find healthy cats with below-average CAT degrees. Upon further study, they determined that there is a second factor regulating feline traits, now known as GATA degree. Similar to CAT degree, it’s the number of times that a genetic sequence contains the nucleobases G-A-T-A in that order, ignoring other nucleobases between them.

Today you’ll be crafting fresh DNA sequences in the lab. We will ask you for short genetic sequences (at most nucleobases) having specific GATA and CAT degrees. Please write a program to assist in our research.

输入格式

The first line contains an integer () indicating the number of sequences that must be crafted.

Each of the next lines contains two integers and (), representing respectively the required GATA and CAT degrees.

输出格式

For each request in the input, output a line with a non-empty string of at most uppercase letters “C”, “G”, “A”, or “T”, having the specified GATA and CAT degrees.

It can be proven that a valid answer exists under the given constraints. If there are multiple solutions, output any of them; there is no need to minimize the length of the strings.

样例

样例输入 1

4
1 1
2 3
18 1
2 1

样例输出 1

CGATA
ATGGCATATC
GGAAATTTCAT
GATACAT

样例输入 2

5
1 0
0 1
1 1
0 0
0 0

样例输出 2

GATA
CAT
CGATA
T
TTTTTTTTTTT