#include <iostream>
#include <exception>
using namespace std;
class ClassFullException : public exception{
    public:
    const char*what() const noexcept override{
        return "Error:Insufficient slots";
    }
};
int main(){
    int availableSlots, students;
    cin>>availableSlots;
    cin>>students;
    try{
        if(availableslots<0 || students<0){
            cout<<"Invalid input";
        }
        if(students>availableSlots){
            throw ClassFullException();
        }
        cout<<"Enrollment successful";
    }
    catch(const char*msg){
        cout<<msg;
    }
    catch(const ClassFullException& e){
        cout<<e.what();
    }
    return 0;
}