One dimensional maze