Frontier to buy Spirit Airlines in $2.9 billion deal