五月天青色头像情侣网名,国产亚洲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的評論 (共 條)

分享到微博請遵守國家法律
盐池县| 枣强县| 鹤山市| 合川市| 昌宁县| 吉安县| 延吉市| 清苑县| 城市| 长阳| 黄平县| 沁阳市| 宁安市| 马龙县| 新密市| 阿城市| 资中县| 福清市| 沙洋县| 佳木斯市| 宜城市| 青冈县| 武鸣县| 滨海县| 象山县| 磐安县| 建平县| 荔波县| 大田县| 丰城市| 张家港市| 广宁县| 呼伦贝尔市| 资源县| 保定市| 岑溪市| 满城县| 三河市| 淄博市| 馆陶县| 南安市|