var input = ""
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
 
process.stdin.on('end', function() {
  arr = [];
  for (i = 0; i < 52; i++) {
    switch (Math.floor(i / 13)) {
      case 0:
        arr.push("S " + (i + 1));
        break;
      case 1:
        arr.push("H " + (i % 13 + 1));
        break;
      case 2:
        arr.push("C " + (i % 13 + 1));
        break;
      case 3:
        arr.push("D " + (i % 13 + 1));
        break;
    }
  }

  
  input = input.split("\n");
  i = 1
  while (input[i] != 0) {
    console.log(i);
    for (j = 0; j < arr.length; j++) {
      if (arr[j] == input[i]) {
        arr.splice(j, 1);
      }
    }
    i++;
  }
  console.log(arr.join("\n"));
  console.log();
});