can now find 3 segments given longmaze input but it's quite hacky