    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (true){
            String line = scanner.nextLine();
            if (line.equals("end")){
                break;
            }
            StringBuilder result = new StringBuilder(line).reverse();
