Solved AOJ 0096, 0097 and 0256