#include <iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
int n,r,i,j,k;
int a[100];
string MZ=" A 2 3 4 5 6 7 8 910 J Q K";
char HS[4]= {6,3,5,4};
int main()
{
for (i=0; i<=51; i++) a[i]=i;
srand((int)time(NULL));
for (i=0; i<=50; i++)
{
j=rand()%52;
swap(a[i],a[j]);
}
for (i=0; i<=51; i++)
{
cout<<HS[a[i]/13];
cout<<MZ[2*(a[i]%13)];
cout<<MZ[2*(a[i]%13)+1];
cout<<' ';
if (i%13==12) cout<<endl;
}
return 0;
}