local ffi = require 'ffi' local C, ct = ffi.C, ffi.typeof 'uint8_t[1]' ffi.cdef 'int scanf(const char *, ...);' io.write((function (h, w, c) local a={} for i=1,3 do C.scanf("%u%u",h,w) a[i]={string.char(c+i),h[0],w[0]} end table.sort(a, function (a,b) return a[2]==b[2] and a[3]b[2] end) return a[1][1],"\n",a[2][1],"\n",a[3][1],"\n" end)(ct(), ct(), string.byte("A")-1))