Ternary gas separation using two different membranes