#include using namespace std; #define rep(i, n) for(int i=0; i<(int)(n); i++) #define rep1(i, n) for(int i=1; i<(int)(n); i++) typedef long long ll; typedef vector vi; typedef vector wi; int main(){ cin.tie(0); ios::sync_with_stdio(false); int a, b, c; cin >> a >> b >> c; int maxh=max(max(a, b), c); if(maxh==a){ if(b>c)cout << "A\nB\nC\n"; else cout << "A\nC\nB\n"; } else if(maxh==b){ if(a>c)cout << "B\nA\nC\n"; else cout << "B\nC\nA\n"; } else{ if(a>b)cout << "C\nA\nB\n"; else cout << "C\nB\nA\n"; } return 0; }