#include<stdio.h>
#include<string.h>
void check(int n, char k[52], int a[52], const char *w) {
	int i, j;
	int b[13] = { 0,0,0,0,0,0,0,0,0,0,0,0,0 };
	for (i = 0; i<n; i++) {
		if (!strcmp(k[i], w)) {
			for (j = 1; j <= 13; j++) {
				if (a[i] == j) {
					b[j] == 1;
				}
			}
			for (j = 1; j <= 13; j++)
			{
				if (b[j] == 0) {
					printf("%s %d\n", k[i], j);
				}
			}
		}
	}
}
int main() {//shcd
	int n;
	int a[52];
	char k[52];
	int i, j;
	scanf("%d", &n);
	for (i = 0; i<n; i++) {
		scanf("%s %d", &k[i], &a[i]);
	}
	check(n, k, a, "S");
	check(n, k, a, "H");
	check(n, k, a, "C");
	check(n, k, a, "D");
	return 0;
}