#include using namespace std; int main(){ int a,b,c; cin >> a >> b >> c; if(a>b && a>c){cout << "A\n"; if(b>c) cout << "B\nC\n";else cout << "C\nB\n"; }else if(b>a && b>c){cout << "B\n"; if(a>c) cout << "A\nC\n"; else cout << "C\nA\n"; }else{cout << "C\n"; if(a>b) cout << "A\nB\n"; else cout << "B\nA\n";} return 0; }