#include<stdio.h>
#include<algorithm>
using namespace std;
int a[4];
int main()
{
    int i,j,p,q,r;scanf("%d%d%d",&p,&q,&r);
    a[1]=p;a[2]=q;a[3]=r;int minn=500;
    do
    {
        char c1,c2,c3;
        if(a[1]==p&&a[2]==q&&a[3]==r) c1='A',c2='B',c3='C';
        if(a[1]==p&&a[2]==r&&a[3]==q) c1='B',c2='A',c3='C';
        if(a[1]==r&&a[2]==q&&a[3]==p) c1='A',c2='C',c3='B';
        if(a[1]==r&&a[2]==p&&a[3]==q) c1='C',c2='A',c3='B';
        if(a[1]==q&&a[2]==p&&a[3]==r) c1='C',c2='B',c3='A';
        if(a[1]==q&&a[2]==r&&a[3]==p) c1='B',c2='C',c3='A';
        printf("The sum of the flight times in the route%c\\rightarrow%c\\rightarrow%c:",c1,c2,c3);
        printf("%d + %d = %d hours",a[1],a[2],a[1]+a[2]);
        printf("\n");
        if(a[1]+a[2]<minn) minn=a[1]+a[2];
    }while(next_permutation(a+1,a+4));
    printf("The minimum of these is %d hours.",a[1]+a[2]);
}
