Solution to Sphere Online Judge problem 14: I-Keyboard