use std::io::{self, BufRead}; fn main() { let stdin = io::stdin(); let mut lines = stdin.lock().lines(); let line = lines.next().unwrap().unwrap(); let mut iter = line.split_whitespace(); // is_palindrome function pub fn is_palindrome(s: &str) -> bool { s.chars().rev().collect::() == s } // input string let s = iter.next().unwrap(); let s = s.to_string(); // if s is palindrome, print s, else print s+reverse(s) if is_palindrome(&s) { println!("{}", s); } else { println!("{}{}", s, s.chars().rev().collect::()); } }