#include <vector>
#include <memory>
#include <iostream>


using namespace std;

using Id = int;

class HRSystem;
class Staff;
using PStaff = shared_ptr<Staff>;
using UStaff = unique_ptr<Staff>;

class HRSystem {
public:
    HRSystem() : staffId_(0) {}

    Id addEmployee(); //nowy pracownik etatowy, zwraca Id
    Id addTrainee();  //nowy stazysta, zwraca Id
    Id addManager();  //nowy kierownik, zwraca Id

    const vector<PStaff>& getStaff() const { return staff_; }
private:
    int staffId_;
    vector<PStaff> staff_;
};

//hierarchia osob zatrudnionych
class Staff {
public:
    Staff(HRSystem& owner, Id id) : owner_(owner), id_(id){}
    virtual ~Staff() {}

    virtual void addStaff(PStaff s) {}
protected:
    HRSystem& owner_;
    Id id_;
};

class Employee : public Staff {
public:
    Employee(HRSystem& owner, Id id) : Staff(owner, id){}
};

class Trainee : public Staff {
public:
    Trainee(HRSystem& owner, Id id) : Staff(owner, id){}
};

class Manager : public Staff {
public:
    Manager(HRSystem& owner, Id id) : Staff(owner, id){}
    void addStaff(PStaff s) { staff_.push_back(s); }
private:
    vector<PStaff> staff_; //podwladni
};


Id HRSystem::addEmployee() {
    Id id = ++staffId_;
    staff_.push_back(make_shared<Employee>(*this, id) );
    return id;
}

Id HRSystem::addTrainee() {
    Id id = ++staffId_;
    staff_.push_back(make_shared<Trainee>(*this, id) );
    return id;
}

Id HRSystem::addManager() {
    Id id = ++staffId_;
    staff_.push_back(make_shared<Manager>(*this, id) );
    return id;
}




int main() {
    HRSystem hr;
    hr.addEmployee();
    hr.addTrainee();
    hr.addManager();

    const vector<PStaff>& v = hr.getStaff();
    cout << v.size() << endl;
    return 0;
}
