codeforces; solve "cAPS lOCK" from Beta Round #95 (Div. 2)