CF2044B.Normal Problem

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Normal Problem

A string consisting of only characters 'p', 'q', and 'w' is painted on a glass window of a store. Ship walks past the store, standing directly in front of the glass window, and observes string aa. Ship then heads inside the store, looks directly at the same glass window, and observes string bb.

Ship gives you string aa. Your job is to find and output bb.

Input

The first line contains an integer tt (1t1001 \leq t \leq 100) — the number of test cases.

The only line of each test case contains a string aa (1a1001 \leq |a| \leq 100) — the string Ship observes from outside the store. It is guaranteed that aa only contains characters 'p', 'q', and 'w'.

Output

For each test case, output string bb, the string Ship observes from inside the store, on a new line.

Samples

5
qwq
ppppp
pppwwwqqq
wqpqwpqwwqp
pqpqpqpq
pwp
qqqqq
pppwwwqqq
qpwwpqwpqpw
pqpqpqpq

在线编程 IDE

建议全屏模式获得最佳体验