Codeforces Round #556 (Div. 1) B - Three Religions DP

NoSuchKey