import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	}
} Main public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	} main {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    } catch(IOException e) {   System.out.println("Exception : " + e);
		    } IOException e {   System.out.println("Exception : " + e);
		    } System.out.println("Exception : " + e) System.out.println System.out System System.out "Exception : " + e "Exception : " e {
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      } int Array_input[][]=new int[4][14]; Array_input new int[4][14] 4 14 String az=input.readLine(); az input.readLine() input.readLine input int a=Integer.parseInt(az); a Integer.parseInt(az) Integer.parseInt Integer az int egara_num=0; egara_num 0 int c=0; c 0 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 } int s=0; int s=0; s 0 s<a s a s++ s++ s {
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 } {
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 } String ab = input.readLine(); ab input.readLine() input.readLine input String []strAry = ab.split(" "); strAry ab.split(" ") ab.split ab " " String b=strAry[0]; b strAry[0] strAry 0 if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            } b.equals("S") b.equals b "S" {
		        	   egara_num=0;
		            } egara_num=0 egara_num 0 if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            } b.equals("H") b.equals b "H" {
		        	    egara_num=1;
		            } egara_num=1 egara_num 1 if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            } b.equals("C") b.equals b "C" {
		        	    egara_num=2;
		            } egara_num=2 egara_num 2 if(b.equals("D")){
		        	    egara_num=3;
		            } b.equals("D") b.equals b "D" {
		        	    egara_num=3;
		            } egara_num=3 egara_num 3 c=Integer.parseInt(strAry[1]) c Integer.parseInt(strAry[1]) Integer.parseInt Integer strAry[1] strAry 1 Array_input[egara_num][c]=(egara_num*100)+c Array_input[egara_num][c] Array_input[egara_num] Array_input egara_num c (egara_num*100)+c (egara_num*100) egara_num 100 c int Array[][]=new int[4][14]; Array new int[4][14] 4 14 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     } int i=0; int i=0; i 0 i<4 i 4 i++ i++ i {
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     } {
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     } for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      } int j=1; int j=1; j 1 j<14 j 14 j++ j++ j {
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      } {
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      } Array[i][j]=(i*100)+j Array[i][j] Array[i] Array i j (i*100)+j (i*100) i 100 j if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        } Array[i][j]!=(Array_input[i][j]) Array[i][j] Array[i] Array i j (Array_input[i][j]) Array_input[i] Array_input i j {
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        } int num=Array[i][j]; num Array[i][j] Array[i] Array i j if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 } num<100 num 100 {
                    		System.out.println("S"+" "+j);
                    	 } System.out.println("S"+" "+j) System.out.println System.out System System.out "S"+" "+j "S"+" "+j "S" " " j if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 } num>100&&num<200 num>100 num 100 num<200 num 200 {
                    		 System.out.println("H"+" "+j);
                    	 } System.out.println("H"+" "+j) System.out.println System.out System System.out "H"+" "+j "H"+" "+j "H" " " j if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 } num>200&&num<300 num>200 num 200 num<300 num 300 {
                    		 System.out.println("C"+" "+j);
                    	 } System.out.println("C"+" "+j) System.out.println System.out System System.out "C"+" "+j "C"+" "+j "C" " " j {
                    		 System.out.println("D"+" "+j);
                    	 } System.out.println("D"+" "+j) System.out.println System.out System System.out "D"+" "+j "D"+" "+j "D" " " j String[] args args public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	}
} public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String[] args) {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));

        try{
        //??¨?????????????????\???????????????????????????????????????????´?????????????

                  //??\????????????????????????????????¨???????????????????????????
        	int Array_input[][]=new int[4][14];
        	     String az=input.readLine();
        	     int a=Integer.parseInt(az);
                 //egara_num?????????????????¨??????
        	     int egara_num=0;
        	     int c=0;
                 //??\????????????a????????°???.?????????Array_input???????´??????\??????
                 for(int s=0;s<a;s++){
			        String ab = input.readLine();
		            String []strAry = ab.split(" ");
		            String b=strAry[0];
                 //?????????????????????????????\??????????????¨??????????????????
		            if(b.equals("S")){
		        	   egara_num=0;
		            }else if(b.equals("H")){
		        	    egara_num=1;
		            }else if(b.equals("C")){
		        	    egara_num=2;
		            }else if(b.equals("D")){
		        	    egara_num=3;
		            }
		             c=Integer.parseInt(strAry[1]);
		             //?????????????????§?????????????´?
                Array_input[egara_num][c]=(egara_num*100)+c;

                //System.out.println(Array_input[egara_num][c]);
                 }

                 int Array[][]=new int[4][14];
                 for(int i=0; i<4; i++){
                     for(int j=1; j<14; j++){
                      		Array[i][j]=(i*100)+j;
                      		//??????Array???????´??????????Array_input???????´?????????????
                      if(Array[i][j]!=(Array_input[i][j])){
                    	 int num=Array[i][j];
                    	if(num<100){
                    		System.out.println("S"+" "+j);
                    	 }else if(num>100&&num<200){
                    		 System.out.println("H"+" "+j);
                    	 }else if(num>200&&num<300){
                    		 System.out.println("C"+" "+j);
                    	 }else{
                    		 System.out.println("D"+" "+j);
                    	 }

                        }

                      }

                     }


		      }catch(IOException e) {   System.out.println("Exception : " + e);
		    }

	//60

	}
}