#include <bits/stdc++.h>
using namespace std;
int prepareLPSArray(string pattern) {
  int len = pattern.length();
  vector<int> lsp(len);
  lsp[0] = 0;
  for (int j = 0, i = 1; i < len; i++) {
    if (pattern[i] == pattern[j]) {
      lsp[i] = j + 1;
      j++;
    } else {
      while (true) {
        if (j == 0 || pattern[j] == pattern[i]) break;
        j = lsp[j - 1];
      }
      if (pattern[j] == pattern[i]) {
        lsp[i] = j + 1;
        j++;
      } else
        lsp[i] = 0;
    }
  }
  return lsp[len - 1];
}
string findPalin(string s) {
  string res = s;
  string revS = string(s.rbegin(), s.rend());
  int noOfChars = s.length() - prepareLPSArray(revS + "#" + s);
  for (int i = noOfChars - 1; i >= 0; i--) res.append(1, s[i]);
  return res;
}
int main() {
  long long int i, j, k, n, m, t;
  string s;
  cin >> s;
  cout << findPalin(s) << "\n";
}
