#include<iostream>
using namespace std;
char res[7];
int n=6;
char a[7]={'A','B','D','E','C','F','G'};
void bulid(int l1,int h1,int l2,int h2){
//为什么这么写? 前面的l1 和h1是分别代表着 从什么位置拿走字母 也就是我们一开始所需要的确定l1(通过先序的规律 后面的为了确定h2 也就是确定放在那(通过后序的规律
if(h1 >=l1 ){
res[h2] = a[l1];
int mid = (h1-l1)/2;
bulid(l1+1,l1+mid,l2,l2+mid-1);
bulid(l1+mid+1,h1,l2+mid,h2-1);
}
}
int main(){
bulid(0,6,0,6);
for(int i=0;i<7;i++){
cout << res[i] <<" ";
}
return 0;
}