import java.util.Arrays;
import java.util.Scanner;
import java.util.ArrayList;
import java.io.*;

public class Problem_2_Orphan_Black {
    
    public static void main(String[] args) {
        
        try {
            Scanner scanner = new Scanner(new File("F:\\data\\DATA22.txt"));
            ArrayList<String> list = new ArrayList<String>();
            
            while (scanner.hasNextLine()) {
                list.add(scanner.nextLine());
            }
            
            for (int l = 0; l < list.size(); l+=2) {
                
                String line = list.get(l);
                
                String binary1 = convertToBinary1(line.trim());
                String binary2 = convertToBinary2(line.trim());
                
                for (int i = 0; i < 7; i++) {
                    
                    String s1 = binary1.substring(i);
                    String s2 = binary2.substring(i);
                    
                    int numberOfBytes = s1.length() / 8;
                    
                    //for (int j = 0; j < numberOfBytes * 8; j++) {
                        
                        String[] bytes1 = new String[numberOfBytes];
                        String[] bytes2 = new String[numberOfBytes];
                        
                        for (int k = 0; k < numberOfBytes; k++) {
                            bytes1[k] = s1.substring(k * 8, ((k + 1) * 8));
                            bytes2[k] = s2.substring(k * 8, ((k + 1) * 8));
                        }
                        
                        //System.out.println(areBytesValid(bytes1));
                        //System.out.println(areBytesValid(bytes2));
                        
                        if (areBytesValid(bytes1)) {
                            for (String b : bytes1) {
                                System.out.print(toChar(b));
                            }
                            System.out.println();
                        }
                        
                        if (areBytesValid(bytes2)) {
                            for (String b : bytes2) {
                                System.out.print(toChar(b));
                            }
                            System.out.println();
                        }
                        
                    //}
                }
                
            }
            
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("Exception");
        }
        
    }
    
    public static boolean areBytesValid(String[] bytes) {
        for (int i = 0; i < bytes.length; i++) {
            if (!isValid(bytes[i])) return false;
        }
        return true;
    }
    
    public static String toChar(String b) {
        
        int one = Integer.parseInt(b.substring(0, 1));
        int two = Integer.parseInt(b.substring(1, 2));
        int three = Integer.parseInt(b.substring(2, 3));
        int four = Integer.parseInt(b.substring(3, 4));
        int five = Integer.parseInt(b.substring(4, 5));
        int six = Integer.parseInt(b.substring(5, 6));
        int seven = Integer.parseInt(b.substring(6, 7));
        int eight = Integer.parseInt(b.substring(7, 8));
        
        int n = one*128 + two*64 + three*32 + four*16 + five*8 + six*4 + seven*2 + eight*1;
        
        return (String.valueOf((char)n));
    }
    
    public static boolean isValid(String b) {
        if (b.length() != 8) return false;
        
        int one = Integer.parseInt(b.substring(0, 1));
        int two = Integer.parseInt(b.substring(1, 2));
        int three = Integer.parseInt(b.substring(2, 3));
        int four = Integer.parseInt(b.substring(3, 4));
        int five = Integer.parseInt(b.substring(4, 5));
        int six = Integer.parseInt(b.substring(5, 6));
        int seven = Integer.parseInt(b.substring(6, 7));
        int eight = Integer.parseInt(b.substring(7, 8));
        
        int n = one*128 + two*64 + three*32 + four*16 + five*8 + six*4 + seven*2 + eight*1;
        
        return (n >= 65 && n <=90 || n == 32);
    }
    
    public static String convertToBinary1(String DNA) {
        String re = "";
        for (int i = 0; i < DNA.length(); i++) {
            if (DNA.substring(i, i+1).equals("A") || DNA.substring(i, i+1).equals("T")) {
                re += "1";
            }
            else {
                re += "0";
            }
        }
        return re;
    }
    
    public static String convertToBinary2(String DNA) {
        String re = "";
        for (int i = 0; i < DNA.length(); i++) {
            if (DNA.substring(i, i+1).equals("A") || DNA.substring(i, i+1).equals("T")) {
                re += "0";
            }
            else {
                re += "1";
            }
        }
        return re;
    }
}