A neonate has Apgar scores of 8 and 8.
He is pink when actively crying, but cyanosis and retractions appear when he is quiet.

What is most likely diagnosis?