solution with 1 bug... for 9191
solve by yourself sir...