#include <string.h>
#include <stdlib.h>
int hurufToInt(char* huruf) {
if (!strcmp(huruf,"C")) return 0;
else if (!strcmp(huruf,"C#")) return 1;
else if (!strcmp(huruf,"D")) return 2;
else if (!strcmp(huruf,"D#")) return 3;
else if (!strcmp(huruf,"E")) return 4;
else if (!strcmp(huruf,"F")) return 5;
else if (!strcmp(huruf,"F#")) return 6;
else if (!strcmp(huruf,"G")) return 7;
else if (!strcmp(huruf,"G#")) return 8;
else if (!strcmp(huruf,"A")) return 9;
else if (!strcmp(huruf,"A#")) return 10;
else if (!strcmp(huruf,"B")) return 11;
}
char* intToHuruf(int huruf) {
char temp[10] = "";
if (huruf == 0) strcpy(temp,"C");
else if (huruf == 1) strcpy(temp,"C#");
else if (huruf == 2) strcpy(temp,"D");
else if (huruf == 3) strcpy(temp,"D#");
else if (huruf == 4) strcpy(temp,"E");
else if (huruf == 5) strcpy(temp,"F");
else if (huruf == 6) strcpy(temp,"F#");
else if (huruf == 7) strcpy(temp,"G");
else if (huruf ==

else if (huruf == 9) strcpy(temp,"A");
else if (huruf == 10) strcpy(temp,"A#");
else if (huruf == 11) strcpy(temp,"B");
return temp;
}
int main() {
char data[2000]="";
bool music[12][12];
music[0][0] = 1; //C
music[0][1] = 0; //C#
music[0][2] = 1; //D
music[0][3] = 0; //D#
music[0][4] = 1; //E
music[0][5] = 1; //F
music[0][6] = 0; //F#
music[0][7] = 1; //G
music[0][8] = 0; //G#
music[0][9] = 1; //A
music[0][10] = 0; //A#
music[0][11] = 1; //B
for (int i=1; i<12; i++) {
for (int j=1; j<12;j++) {
music[j] = music[i-1][j-1];
}
music[0] = music[i-1][11];
}
bool kel = false;
while (!kel) {
gets(data);
if (strcmp(data,"END")) {
char* huruf;
bool result[12];
for (int i=0; i<12; i++) {
result = 1;
}
huruf = strtok(data," ");
while (huruf!=NULL) {
for (int i=0; i<12; i++)
result &= music[hurufToInt(huruf)];
huruf = strtok(NULL," ");
}
int jum=0;
for (int i=0; i<12; i++) {
if (result) {
if (jum) printf(" ");
jum++;
char tResult[10] = "";
strcpy(tResult,intToHuruf(i));
printf("%s",tResult);
}
}
printf("\n");
} else kel = true;
}
//getch();
return 0;
}