五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 1758A - SSeeeeiinngg DDoouubbllee

2023-08-11 13:45 作者:您是打尖兒還是住店呢  | 我要投稿

A palindrome is a string that reads the same backward as forward. For example, the strings z, aaa, aba, and abccba are palindromes, but codeforces and ab are not.

The double of a string s is obtained by writing each character twice. For example, the double of seeing is sseeeeiinngg.

Given a string s, rearrange its double to form a palindrome. Output the rearranged string. It can be proven that such a rearrangement always exists.


Input The first line of input contains t (1≤t≤1000) — the number of test cases.

The only line of each test case contains a single string s (1≤|s|≤100) consisting only of lowercase English letters.


Note that the sum of |s| over all test cases is not bounded.


Output

For each test case, output a palindromic string of length 2?|s| that is a rearrangement of the double of s.

----------------------------------------

回文是向后讀與向前讀相同的字符串。 例如,字符串 z、aaa、aba 和 abccba 是回文,但 codeforces 和 ab 不是回文。

字符串 s 的 double 是通過將每個字符寫入兩次而獲得的。 例如,“看見”的雙重含義是“sseeeeiinngg”。

給定一個字符串 s,重新排列它的雙精度數(shù)以形成回文。 輸出重新排列的字符串。 可以證明這樣的重排總是存在的。


輸入 第一行輸入包含 t (1≤t≤1000) — 測試用例的數(shù)量。

每個測試用例的唯一行包含一個僅由小寫英文字母組成的字符串 s (1≤|s|≤100)。


請注意 |s| 的總和 所有測試用例都不受限制。


輸出

對于每個測試用例,輸出長度為 2?|s| 的回文字符串 這是雙 s 的重新排列。

------------------------------------------------------------

回文構造;

代碼如下:


CF 1758A - SSeeeeiinngg DDoouubbllee的評論 (共 條)

分享到微博請遵守國家法律
吉安县| 裕民县| 苏尼特右旗| 中西区| 四平市| 射阳县| 普兰县| 余姚市| 龙海市| 青冈县| 温州市| 河源市| 隆化县| 黄浦区| 梨树县| 澄城县| 许昌县| 军事| 共和县| 湾仔区| 图们市| 南皮县| 桐乡市| 屯留县| 古蔺县| 连江县| 门源| 大足县| 铜鼓县| 女性| 永德县| 若羌县| 凤凰县| 云和县| 田林县| 镇雄县| 北流市| 兰溪市| 吉水县| 北碚区| 龙海市|