Extraction of gas with nitrogen