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?

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. <SEP> The 2003–04 NBA season season was the 16th season for the Miami Heat in the National Basketball Association.  This season saw the team draft future All-Star and 3-time NBA Champion Dwyane Wade with the fifth overall pick in the 2003 NBA draft, while acquiring forward Lamar Odom from the Los Angeles Clippers.  Before the season began, head coach Pat Riley resigned, but he would later return midway in the 2005–06 season and help guide the Heat to their first ever NBA championship.  Under new head coach Stan Van Gundy, the Heat stumbled out of the gate losing their first seven games.  However, the team would play .500 basketball for the remainder of the season winning 14 of their final 17 games.  Despite posting a mediocre 42–40 record, the Heat entered the playoffs as the #4 seed in the Eastern Conference.  Wade had a stellar rookie season averaging 16.2 points per game, and was selected to the All-Rookie First Team. <SEP> 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. <SEP>  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 2005–06 Miami Heat season was the 18th National Basketball Association season for the Miami Heat basketball franchise.  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.