-     #include <iostream> 
-     #include <string> 
-     #include <vector> 
-     #include <memory> 
-     #include <algorithm> 
-   
-     class Student { 
-     private: 
-         std::string name; 
-   
-     public: 
-         Student(const std::string& name_) : name(name_) {} 
-         const std::string& getName() const { return name; } 
-     }; 
-   
-     class Class { 
-     private: 
-         typedef std::vector<std::shared_ptr<Student>> SubscriptionList; 
-         SubscriptionList students; 
-         const unsigned int MaxSubscribers; 
-   
-     public: 
-         Class(unsigned int maxSubscribers) : MaxSubscribers(maxSubscribers) {} 
-   
-         bool subscribe(std::shared_ptr<Student>& student) { 
-             if(students.size() >= MaxSubscribers) { 
-                 return false; // Class is full, can't subscribe 
-             } 
-   
-             // May be put additional checks here, to prevent multiple subscrptions 
-             students.push_back(student); 
-             return true; // Sucessfully subscribed the class 
-         } 
-   
-         void unsubscribe(std::shared_ptr<Student>& student) { 
-             SubscriptionList::iterator it = students.begin(); 
-             for(;it != students.end();++it) { 
-                 if(it->get() == student.get()) { 
-                     break; 
-                 } 
-             } 
-             students.erase(it); 
-         } 
-   
-         void showSubscribedStudents(std::ostream& os) { 
-         	unsigned int i = 1; 
-             for(SubscriptionList::iterator it = students.begin(); 
-                 it != students.end(); 
-                 ++it, ++i) { 
-                 os << i << ". " << (*it)->getName() << std::endl; 
-             } 
-         } 
-     }; 
-   
-     int main() 
-     { 
-         unsigned int amount; 
-         std::cin >> amount; 
-         std::cin.ignore(1,'\n'); 
-   
-         Class theClass(amount); 
-   
-         for(unsigned int i = 0; i <= amount; ++i) 
-         { 
-             std::string name; 
-             std::getline(std::cin,name); 
-             std::shared_ptr<Student> student(new Student(name)); 
-             theClass.subscribe(student); 
-         } 
-   
-         theClass.showSubscribedStudents(std::cout); 
-     } 
-   
-