q6 with path reconstruction; dict[]