{
			if (A[j].num<A[j-1].num){
				t=A[j];A[j]=A[j-1];A[j-1]=t;
				flag=1;
			}
		}
	}
}

void selectSort(struct CARD A[],int N)
{
	struct CARD t;
	int minj,j,i;
	for (i=0;i<N-1;i++){
		minj=i;
		for (j=i+1;j<N;j++){
			if (A[j].num<A[minj].num)minj=j;
		}
		t=A[i];A[i]=A[minj];A[minj]=t;
	}
}

void trace(struct CARD A[],int N)
{
	int i;
	for (i=0;i<N;i++){
		if (i>0)printf(" ");
		printf("%c%d",A[i].color,A[i].num);
	}
	printf("\n");
 } 
 
void isStable(struct CARD input[],struct CARD output[],int N)
 {
 	int i,j,k,m,ct;
 	for (i=0;i<N-1;i++){
 		ct=1;
 		for (j=i+1;j<N;j++){
 			if (output[i].num==output[j].num)
 			ct++;
		 }
		 m=ct;
		 if (ct>1){
		 	for(k=0;ct>0;k++){
		 		if (output