package com.codegym.task.task07.task0727; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; /* Changing functionality */ public class Solution { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); ArrayList<String> list = new ArrayList<String>(); while (true) { String s = reader.readLine(); if (s.isEmpty()) break; list.add(s); // if(s.length()%2==0) // System.out.println(s+" "+s) ; // else // System.out.println(s+" "+s+" "+s) ; } // ArrayList<String> listUpperCase = new ArrayList<String>(); //for (int i = 0; i < list.size(); i++) { // String s = list.get(i); // listUpperCase.add(s.toUpperCase()); //System.out.println(list.get(i)); // } for (int i = 0; i < list.size(); i++) { int x= list.get(i).length(); if(x%2==0) System.out.println(list.get(i)+""+list.get(i)); else System.out.println(list.get(i)+""+list.get(i)+""+list.get(i)); } } }