#include using namespace std; int main(){ int n; cin >> n; string s[n]; string mark[4] = {"D","C","H","S"},num[13] = {"A","2","3","4","5","6","7","8","9","T","J","Q","K"}; for(int i = 0;i < n;i++) cin >> s[i]; for(int i = 0;i < 4;i++){ for(int j = 0;j < 13;j++){ for(int k = 0;k < n;k++){ if(int(s[k].find(mark[i] + num[j])) != -1){ cout << mark[i] + num[j] << ' '; break; } } } } cout << endl; }