#include<stdio.h>
int main(){

	int n;
	int a[4][13];
	int i = 0, j = 0;
	int k = 0;
	int x = 0;
	char m;  

	for (i = 0; i < 4; i++){
		for (j = 0; j < 13; j++){
			a[i][j] = 0;
		}
	}

	scanf_s("%d", &n);

	for (k = 0; k <2*n; k++){
		scanf_s("%c %d", &m, &x);
			 if (m == 'S')a[0][x] = 1;
		else if (m == 'H')a[1][x] = 1;
		else if (m == 'C')a[2][x] = 1;
		else if (m == 'D')a[3][x] = 1;
	}


	for (i = 0; i < 4; i++){
		for (j = 0; j < 13; j++){
			if (a[i][j] == 0){
					 if (i == 0){ printf("S %d\n", j +1); }
				else if (i == 1){ printf("H %d\n", j +1); }
				else if (i == 2){ printf("C %d\n", j +1); }
				else if (i == 3){ printf("D %d\n", j +1); }
			}

		}

	}
	return 0;
}