#include <iostream>
#include <string>
using namespace std;

class Employee {
protected:
    string name;
    float salary;
    public:
    Employee(string name, float salary):
        name(name), salary(salary) {}
        string getName()
        {
            return name;
        }
        float getSalary()
        {
            return salary;
        }
};
class Manager : public Employee
{
    string department;
    public: 
    Manager(string name, float salary, string dept);
    Employee(name, salary), department(dept){}
    string getDepartment()
    {
        return department;
    }
};

void displayDetails(Employee &emp, Manager &mgr)
{
    cout<<"Employee Details: "<<endl;
    cout<<"Name: "<<emp.getName()<<endl;
    cout<<"Salary: "<<int(emp.getSalary())<<endl;
    cout<<endl;
    cout<<"Manager Details: "<<endl;
    cout<<"Name: "<<mgr.getName()<<endl;
    cout<<"Salary: "<<int(mgr.getSalary())<<endl;
    cout<<"Department: "<<mgr.getDepartment()<<endl;
}
int main()
{
    string empName, mgrName, mgrDept;
    float empSalary, mgrSalary;
    
    cin>>empName;
    cin>>empSalary;
    cin>>mgrName;
    cin>>mgrSalary;
    cin>>mgrDept;
    
    if(empSalary < 0 || mgrSalary < 0 )
    {
        cout<<"Invalid input"<<endl;
        return 0;
    }
    Employee emp(empName, empSalary);
    Manager mgr(mgrName, mgrSalary, mgrDept);
    displayDetails(emp, mgr);
    return 0;
}