Palindromic Supersequence

题意翻译

# 题目描述 给定一个字符串$A$,要你找一个字符串$B$,保证它是一个回文字符串,且$A$是$B$的一个子序列。(例如给定一个字符串$ab$,会有一个满足条件的字符串$aabaa$,因为$aabaa$倒过来念还是$aabaa$,且$ab$是$aabaa$的一个子序列) # 输入输出格式 ## 输入 输入一个字符串$A$($1$≤|$A$|≤$10^3$),其中|$A$|是字符串的长度。 ## 输出 输出一个满足条件的字符串$B$,保证$B$的长度最多不超过$10^4$。 ## 样例输入1 aba ## 样例输出1 aba ## 样例输入2 ab ## 样例输出2 aabaa # 提示与说明 ## 1. 本题不需要找到满足条件的所有字符串$B$当中最小的一个,只需输出一解即可。 ## 2. 保证有解。 感谢@王轶凡lg2018 提供的翻译

题目描述

You are given a string $ A $ . Find a string $ B $ , where $ B $ is a palindrome and $ A $ is a subsequence of $ B $ . A subsequence of a string is a string that can be derived from it by deleting some (not necessarily consecutive) characters without changing the order of the remaining characters. For example, "cotst" is a subsequence of "contest". A palindrome is a string that reads the same forward or backward. The length of string $ B $ should be at most $ 10^{4} $ . It is guaranteed that there always exists such string. You do not need to find the shortest answer, the only restriction is that the length of string $ B $ should not exceed $ 10^{4} $ .

输入输出格式

输入格式


First line contains a string $ A $ ( $ 1<=|A|<=10^{3} $ ) consisting of lowercase Latin letters, where $ |A| $ is a length of $ A $ .

输出格式


Output single line containing $ B $ consisting of only lowercase Latin letters. You do not need to find the shortest answer, the only restriction is that the length of string $ B $ should not exceed $ 10^{4} $ . If there are many possible $ B $ , print any of them.

输入输出样例

输入样例 #1

aba

输出样例 #1

aba

输入样例 #2

ab

输出样例 #2

aabaa

说明

In the first example, "aba" is a subsequence of "aba" which is a palindrome. In the second example, "ab" is a subsequence of "aabaa" which is a palindrome.