#include<iostream> #include<string> #include<list> #include<algorithm> using namespace std; int main(int argc, char *argv[]){ int bedNum; string customer; while(cin>>bedNum,bedNum){ int departCustomer=0; list<char> mList; cin>>customer; char *cp=new char[customer.length()+1]; customer.copy(cp,customer.length(),0); *(cp+customer.length())='