Natural selection means that the organisms better adapted to their environment, that is, they have developed the right characteristics/skills/response to the external ambient, have higher chance to survive, making the next generations genetically inherit such acquired surviving characteristics. These generations will thus have a higher chance of survival, making these species being "naturally selected" as survivors, while those who haven't or are slower in this process, have a higher risk of elimination.
Answer - They take in C02 (Carbon Dioxide) & Release O2 (Oxygen)
Reasoning - To be able to do Photosynthesis they Plants need C02 which is one of the important components to making Glucose. During that gas exchange they release O2 for C02.