-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU import System.IO import Data.List import Text.Printf main = f 0 where f n = printf "%03d\n" (n::Int) >> hFlush stdout >> getLine >>= \s -> case s of "locked" -> f (n + 1) _ -> return ()