#include <iostream> #include <string> #include <deque> using namespace std; int main() { -int a,c; -deque<int> x; -do{ --cout<<"Arrived from Cairo: "; --cin>>c; --cout<<"Arrived from Alex: "; --cin>>a; --x.push_back(c); --x.push_front(a); -}while(a||c); -while(!x.empty()){ --if(x.back()){ ---cout<< x.back(); ---cout<<" is going to Cairo"<<endl; --} --if(x.front()){ ---cout<< x.front(); ---cout<<" is going to Alex"<<endl; --} --x.pop_front(); --x.pop_back(); -} }