xiaozqh
[srcbox.git] / glass.pas
blob7d448c18456eb2c2f4eeae6462b6c7e0ff9810e9
1 var
2 br,gr,cl:array [0..3] of longint;
3 i,a,b,c,ans,t:longint;
4 minway:string;
6 function trans(a:longint):char;
7 begin
8 case a of
9 1:exit('B');
10 2:exit('C');
11 3:exit('G');
12 end;
13 end;
15 begin
16 for i:=1 to 3 do
17 readln(br[i],gr[i],cl[i]);
18 ans:=maxlongint;
19 for a:=1 to 3 do
20 for b:=1 to 3 do
21 if (a<>b) then
22 for c:=1 to 3 do
23 if (b<>c) and (a<>c) then
24 begin
25 t:=br[b]+br[c]+cl[a]+cl[c]+gr[a]+gr[b];
26 if t<ans then
27 begin
28 ans:=t;
29 minway:=trans(a)+trans(b)+trans(c);
30 end;
31 end;
32 writeln(minway,' ',ans);
33 end.