val a="GA BU ZO MEU"split' '
while(0<1)println((readLine split" . "map{s=>var i=0
BigInt((s/:a)(_.replace(_,{i-=1
~i+""})),4)}sum)toString 4 map(c=>a(c%4))mkString)
Note that non-ascii characters in the above source code will be escaped (such as \x9f).