// editor3
#include<bits/stdc++.h>
using namespace std;
class Employee{
    private:
    string name;
    float salary;
    public:
    void getEmployeeDetails(const string& n, float s){
        name=n;
        salary=s;
    }
    void displayEmployee()const{
        cout<<"Employee Details:\n";
        cout<<"Name: "<<name<<"\n";
        cout<<"salary: "<<fixed<<setprecision(0)<<salary<<"\n";
    }
};
class Manager:public Employee{
    string department;
    public:
    void getManagerDetails(const& n, float s, const string& d){
        name=n;
        salary=s;
        department=d;
    }
    void displayManager()const{
        cout<<"Manager Details:\n";
        cout<<"Name: "<<name<<"\n";
        cout<<"Salary: "<<fixed<<setprecision(0)<<salary<<"\n";
        cout<<"Department"<<department<<"\n";
        }
};
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    string empName, mgrName, mgrDept;
    float empSalary, mgrDept;
    if(!(cin>>empName>>empSalary>>mgrName>>mgrSalary>>mgrDept)){
        cout<<"Invalid input";
        return 0;
    }
    if(empSalary<=0||mgrSalary<=0){
        cout<<"Invalid input";
        return 0;
    }
    Employee e;
    Manager m;
    e. getEmployeeDetails(empName, empSalary);
    m. getManagerDetails(mgrName, mgrSalary, mgrDept);
    e. displayEmployee();
    m.displayManager();
    return 0;
}