question: Which team did the head coach who resigned early in the season of The 2005–06 Miami Heat season go on to coach from 2007 to 2012?
answer: Orlando Magic
context: Title: 2013–14 Miami Heat season
  Passage: The 2013–14 Miami Heat season was the franchise's 26th season in the National Basketball Association (NBA).  They entered the season as two-time defending NBA champions (third overall), and three-time defending Eastern Conference champions, the fourth and final season playing with the "Big Three" of Dwyane Wade, LeBron James, and Chris Bosh, and the sixth season under head coach Erik Spoelstra.  In a rematch of the previous year's Eastern Conference Finals, the Heat defeated the Indiana Pacers in six games to become the first team to win four consecutive Eastern Conference championships since the 1986–87 Boston Celtics capped a Boston-dominant string going back to the 1983–84 season.  Miami's quest for a three-peat ended when the San Antonio Spurs, whom they would meet again in a rematch of last year's NBA Finals and defeated in seven games, won the NBA Finals by a 4–1 margin.  Following the season, LeBron left the Heat to rejoin the Cleveland Cavaliers.
  Title: 2012–13 Miami Heat season
  Passage: The 2012–13 Miami Heat season was the franchise's 25th season in the National Basketball Association (NBA).  They came into the season as the defending NBA champions, back-to-back Eastern Conference champions, the third season playing with the "Big Three" of Dwyane Wade, LeBron James, and Chris Bosh, and the fifth season under head coach Erik Spoelstra.  During the season, the Heat embarked on a 27-game winning streak, which still ranks as the 3rd longest winning streak in a single season in NBA history.  On June 3, 2013, the Heat defeated the Indiana Pacers in game seven of the Eastern Conference Finals to become the first team since the Chicago Bulls in 1998 to Three-peat as Eastern Conference champions.  The Heat then defeated the San Antonio Spurs in an NBA Finals that went the full seven games, handing the Spurs their very first loss in the NBA Finals, and with this victory in the NBA Finals, it echoed the 1997-98 Bulls as they had also been the last Eastern team to repeat as NBA champions.
  Title: Stan Van Gundy
  Passage: Stanley Alan Van Gundy (born August 26, 1959) is an American professional basketball coach, currently serving as the head coach and president of basketball operations of the National Basketball Association's Detroit Pistons.  From 2003 to 2005, he was the head coach of the Miami Heat but resigned in 2005 mid-season, turning the job over to Pat Riley.  Van Gundy then coached the Orlando Magic for five seasons from 2007 to 2012, leading them to the 2009 NBA Finals.  He is the brother of former New York Knicks and Houston Rockets coach Jeff Van Gundy.
  Title: 2016–17 Miami Heat season
  Passage: The 2016–17 Miami Heat season was the 29th season of the franchise in the National Basketball Association (NBA).  After a tumultuous negotiation process, Dwyane Wade decided to leave the Heat and sign with the Chicago Bulls in the offseason.  This was the first season without Wade since the 2003.  Furthermore, Chris Bosh missed the entire season and had thought about potentially retiring altogether due to his continuous blood clots.  The team got off to an 11–30 start.  However the Heat rallied to an 30–11 finish, only to be eliminated all the same on their last game of the season.  They entered game 82 needing a loss from either the Pacers or the Bulls and a victory over the Wizards.  However, despite a 110–102 win over the Washington Wizards, both the Pacers and the Bulls won their games.  The Heat finished tied with the Chicago Bulls with identical 41–41 records but the Bulls won the head-to-head tie breaker against the Heat 2–1.  As a result, the Heat missed the playoffs for the second time in three years.  Hassan Whiteside earned praise for being the NBA's leading rebounder after ending his previous season as the leading shot blocker of the NBA.
  Title: 2005–06 Miami Heat season
  Passage: The 2005–06 Miami Heat season was the 18th National Basketball Association season for the Miami Heat basketball franchise.  During the offseason, the Heat acquired Jason Williams and James Posey from the Memphis Grizzlies, and All-Star forward Antoine Walker from the Boston Celtics, while signing free agent All-Star point guard Gary Payton.  Early into the season, after a 15-12 start to the year, head coach Stan Van Gundy resigned, citing the desire to spend more time with his family, and Pat Riley resume coaching the Heat.  The Heat went 39-23 the rest of the way, finishing with a 52-30 record, good enough for first place in the Southeast Division and second place in the Eastern Conference overall.  Dwayne Wade and Shaquille O'Neal were both selected for the 2006 NBA All-Star Game.
citations: Stan Van Gundy 2005–06 Miami Heat season