function comp(h1, w1, h2, w2) ret = false if(h1 < h2 or (h1 == h2 and w1 > w2)) then ret = true end return ret end ha,wa,hb,wb,hc,wc=io.read("*n", "*n", "*n", "*n", "*n", "*n") if(comp(ha, wa, hb, wb) and comp(ha, wa, hc, wc)) then if(comp(hb, wb, hc, wc)) then print("C") print("B") else print("B") print("C") end print("A") elseif(comp(hb, wb, ha, wa) and comp(hb, wb, hc, wc)) then if(comp(ha, wa, hc, wc)) then print("C") print("A") else print("A") print("C") end print("B") else if(comp(ha, wa, hb, wb)) then print("B") print("A") else print("A") print("B") end print("C") end