#include #define pout(n) printf ("%d\n", n) #define rep(i,a,n) for (int i = a;i < n;i++) #define per(i,n,a) for (int i = n-1;i >= a;i--) const int d4x[4] = {1, 0, -1, 0}; const int d4y[4] = {0, 1, 0, -1}; const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 }; const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 }; typedef long long ll; using namespace std; int main() { int a,b,c; cin >> a >> b >> c; if(a>b && a>c){ printf("A\n"); if(b>c){ printf("B\nC\n"); } else printf("C\nB\n"); } else if(b>a && b>c){ printf("B\n"); if(a>c){ printf("A\nC\n"); } else printf("C\nA\n"); } else{ printf("C\n"); if(a>b){ printf("A\nB\n"); } else printf("B\nA\n"); } return 0; }