for t in io.stdin:lines()do print(t:gsub("^("..("%A*%a"):rep(16).."%A*)(%a)",function(a,b)return a..b:upper()end)or 0)end