#include <iostream>
#include <string>
using namespace std;

class Employee {
    public:
    string n;
    float s;
    
    void get(string a, float b) {
        n = a;
        s = b;
    }
    
    void show() {
        cout << "Employee Details:" << endl;
        cout << "Name: " << n << endl;
        cout << "Salary: " << s << endl;
    }
};

class Manager : public Employee {
    public:
    string d;
    
    void getManager(string a, float b, string c) {
        n = a;
        s = b;
        d = c;
    }
    
    void showManager() {
        cout << endl << "Manager Details:" << endl;
        cout << "Name: " << n << endl;
        cout << "Salary: " << s << endl;
        cout << "Department: " << d << endl;
    }
};

int main() {
    string employee, manager, department;
    float eSalary, mSalary;
    cin >> eSalary >> mSalary;
    cin >> employee >> manager >> department;
    
    Employee e;
    e.get(employee, eSalary);
    e.show();
    
    Manager m;
    m.getManager(manager, mSalary, department);
    m.showManager;
    
    return 0;
}