#include<stdio.h>
int pass[6][6] = {0,5,6,4,999,999,
5,0,1,2,999,999,
6,1,0,2,5,3,
4,2,2,0,999,4,
999,999,5,999,0,4,
999,999,3,4,4,0};
int hav_include[6] = {999,999,999,999,999,999};
char fir_String[6] = {'A','B','C','D','E','F'};
char String[6];
int judge()
{
int loc;
int te_min=999;
int i;
for(i = 0;i<6;i++)
{
if(te_min>hav_include[i]&&hav_include[i]!=0) {loc=i;te_min=hav_include[i];}
}
return loc;
}
void minloc(int i)
{
for(int j = 0;j<6;j++){
if(pass[i][j]<hav_include[j]&&hav_include[j]!=0) hav_include[j]=pass[i][j];
}
}
int jud_end(){
for(int i=0;i<6;i++){
if(hav_include[i]!=0) return 1;
}
return 0;
}
void Prim()
{
int z = 1;
for(int i = 0;i<6;i++){
hav_include[i] = pass[0][i];
}
String[0] = 'A';
while(jud_end())
{
int temp;
temp = judge();
minloc(temp);
String[z]=fir_String[temp];
z++;
}
}
int main()
{
Prim();
for(int i=0;i<6;i++){
printf("%c",String[i]);
if(i!=5){printf("-");}
}
return 0;
}