Juan transferred 100 percent of his stock in Rosa Company to Azul Corporation in a Type B stock-for stock exchange. In exchange, he received stock in Azul with a fair market value of $1,000,000. Juan's tax basis in the Rosa stock was $400,000. What amount of gain does Juan recognize in the exchange and what is his basis in the Azul stock he receives?