import java.util.Scanner;
class Main {
	int [][] cards = new int [5][15];
	private  static String[] cards2 = {"0","S","H","C","D"};
	int n,j,i,k,cards4,Nu;
	String cards3;
	public void ca() {
		Scanner sc = new Scanner(System.in);
		for(j = 1;j <= 4;j++) {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		}
		n = sc.nextInt();
		for(k = 0 ; k < n ; k++) {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		}
		for(j = 1;j <= 4;j++) {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		}
	}
	public static void main(String[] agrs) {
		new Main().ca();
	}
} import java.util.Scanner; Scanner java.util class Main {
	int [][] cards = new int [5][15];
	private  static String[] cards2 = {"0","S","H","C","D"};
	int n,j,i,k,cards4,Nu;
	String cards3;
	public void ca() {
		Scanner sc = new Scanner(System.in);
		for(j = 1;j <= 4;j++) {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		}
		n = sc.nextInt();
		for(k = 0 ; k < n ; k++) {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		}
		for(j = 1;j <= 4;j++) {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		}
	}
	public static void main(String[] agrs) {
		new Main().ca();
	}
} Main int [][] cards = new int [5][15]; cards new int [5][15] 5 15 private  static String[] cards2 = {"0","S","H","C","D"}; cards2 {"0","S","H","C","D"} "0" "S" "H" "C" "D" int n n j j i i k k cards4 cards4 Nu; Nu String cards3; cards3 public void ca() {
		Scanner sc = new Scanner(System.in);
		for(j = 1;j <= 4;j++) {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		}
		n = sc.nextInt();
		for(k = 0 ; k < n ; k++) {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		}
		for(j = 1;j <= 4;j++) {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		}
	} ca {
		Scanner sc = new Scanner(System.in);
		for(j = 1;j <= 4;j++) {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		}
		n = sc.nextInt();
		for(k = 0 ; k < n ; k++) {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		}
		for(j = 1;j <= 4;j++) {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) for(j = 1;j <= 4;j++) {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		} j = 1; j = 1 j 1 j <= 4 j 4 j++ j++ j {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		} {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		} for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			} i = 1 ; i = 1 i 1 i <= 13 i 13 i++ i++ i {
				k = i;
				cards[j][i] = k;
			} {
				k = i;
				cards[j][i] = k;
			} k = i k i cards[j][i] = k cards[j][i] cards[j] cards j i k n = sc.nextInt() n sc.nextInt() sc.nextInt sc for(k = 0 ; k < n ; k++) {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		} k = 0 ; k = 0 k 0 k < n k n k++ k++ k {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		} {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		} cards3 = sc.next() cards3 sc.next() sc.next sc cards4 = sc.nextInt() cards4 sc.nextInt() sc.nextInt sc if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			} cards3.equals( "S" ) cards3.equals cards3 "S" {
				Nu = 1;
			} Nu = 1 Nu 1 if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			} cards3.equals( "H" ) cards3.equals cards3 "H" {
				Nu = 2;
			} Nu = 2 Nu 2 if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			} cards3.equals( "C" ) cards3.equals cards3 "C" {
				Nu = 3;
			} Nu = 3 Nu 3 if(cards3.equals( "D" )) {
				Nu = 4;
			} cards3.equals( "D" ) cards3.equals cards3 "D" {
				Nu = 4;
			} Nu = 4 Nu 4 switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			} Nu case 1: 1 case 1: for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					} j = 1; j = 1 j 1 j <= 13 j 13 j++ j++ j {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					} {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					} if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						} cards4 == cards[1][j] cards4 cards[1][j] cards[1] cards 1 j {
							cards[1][j] -= cards4;
						} cards[1][j] -= cards4 cards[1][j] cards[1] cards 1 j cards4 break; case 2: 2 case 2: for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					} j = 1; j = 1 j 1 j <= 13 j 13 j++ j++ j {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					} {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					} if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						} cards4 == cards[2][j] cards4 cards[2][j] cards[2] cards 2 j {
							cards[2][j] -= cards4;
						} cards[2][j] -= cards4 cards[2][j] cards[2] cards 2 j cards4 break; case 3: 3 case 3: for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					} j = 1; j = 1 j 1 j <= 13 j 13 j++ j++ j {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					} {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					} if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						} cards4 == cards[3][j] cards4 cards[3][j] cards[3] cards 3 j {
							cards[3][j] -= cards4;
						} cards[3][j] -= cards4 cards[3][j] cards[3] cards 3 j cards4 break; case 4: 4 case 4: for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					} j = 1; j = 1 j 1 j <= 13 j 13 j++ j++ j {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					} {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					} if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						} cards4 == cards[4][j] cards4 cards[4][j] cards[4] cards 4 j {
							cards[4][j] -= cards4;
						} cards[4][j] -= cards4 cards[4][j] cards[4] cards 4 j cards4 break; default: default: break; for(j = 1;j <= 4;j++) {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		} j = 1; j = 1 j 1 j <= 4 j 4 j++ j++ j {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		} {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		} for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			} i = 1; i = 1 i 1 i <= 13 i 13 i++ i++ i {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			} {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			} if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				} cards[j][i] != 0 cards[j][i] cards[j] cards j i 0 {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				} System.out.printf("%S %d\n",cards2[j],cards[j][i]) System.out.printf System.out System System.out "%S %d\n" cards2[j] cards2 j cards[j][i] cards[j] cards j i public static void main(String[] agrs) {
		new Main().ca();
	} main {
		new Main().ca();
	} new Main().ca() new Main().ca new Main() String[] agrs agrs
import java.util.Scanner;
class Main {
	int [][] cards = new int [5][15];
	private  static String[] cards2 = {"0","S","H","C","D"};
	int n,j,i,k,cards4,Nu;
	String cards3;
	public void ca() {
		Scanner sc = new Scanner(System.in);
		for(j = 1;j <= 4;j++) {
			for(i = 1 ; i <= 13; i++) {
				k = i;
				cards[j][i] = k;
			}
		}
		n = sc.nextInt();
		for(k = 0 ; k < n ; k++) {
			cards3 = sc.next();
			cards4 = sc.nextInt();
			if(cards3.equals( "S" )) {
				Nu = 1;
			} else if(cards3.equals( "H" )) {
				Nu = 2;
			} else if(cards3.equals( "C" )) {
				Nu = 3;
			} else if(cards3.equals( "D" )) {
				Nu = 4;
			}
			switch(Nu) {
				case 1:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[1][j]) {
							cards[1][j] -= cards4;
						}
					}
					break;
				case 2:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[2][j]) {
							cards[2][j] -= cards4;
						}
					}
					break;
				case 3:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[3][j]) {
							cards[3][j] -= cards4;
						}
					}
					break;
				case 4:
					for(j = 1;j <= 13 ; j++) {
						if(cards4 == cards[4][j]) {
							cards[4][j] -= cards4;
						}
					}
					break;
				default:
					break;
			}
		}
		for(j = 1;j <= 4;j++) {
			for(i = 1;i <= 13;i++) {
				if(cards[j][i] != 0) {
					System.out.printf("%S %d\n",cards2[j],cards[j][i]);
				}
			}
		}
	}
	public static void main(String[] agrs) {
		new Main().ca();
	}
}