public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		StringBuilder out = new StringBuilder();
		while ((line = in.readLine()) != null && line.length() != 0) {
			Manacher m = new Manacher(line);
			int max = 0;
			int center = line.length() - 1;
			for (int i = m.p.length - 3; i >= 0; i--)
				if (max < m.p[i] && m.p[i] + i == m.p.length - 2) {
					max = m.p[i];
					center = i;
				}
			out.append(line);
			for (int i = ((center - 1 - max) / 2) - 1; i >= 0; i--)
				out.append(m.s[i]);
			out.append("\n");
		}
		System.out.print(out);
	}