CodeForces - 791B ——D - Bear and Friendship Condition

NoSuchKey