#include <iostream>
#include <sstream>
#include<cctype>
using namespace std;
class Person{
    protected:
    string name;
    int age;
    public:
    virtual void showDetails(){
        cout<<"Name: "<<name<<endl;
        cout<<"Age: "<<age<<endl;
    }
};
class Employee : public Person{
    private:
    int empID;
    string department;
    public:
    void setDetails(const string& newName, int newAge, int newEmpID, const string& newDepartment){
        name = newName;
        age = newAge;
        empID = newEmpID;
        department = newDepartment;
    }
    void showDetails() override{
        Person :: showDetails();
        cout<<"Employee ID: "<<empID<<endl;
        cout<<"Department: "<<department<<endl;
    }
    bool isValidInput(){
        for(char ch : name){
            if(!isalpha(ch) && ch != ' '){
                return false;
            }
        }
        if(age<0){
            return false;
        }
        return true;
    }
    };
    int main(){
        string personName, employeeDepartment, firstLine, secondLine;
        int personAge, employeeID;
        getline(cin, firstLine);
        stringstream ss1(firstLine);
        ss1>>personName>>personAge;
        getline(cin, secondLine);
        stringstream ss2(secondLine);
        ss2>>employeeID>>employeeDepartment;
        Employee obj;
        obj.setDetails(personName, personAge, emploueeID, employeeDepartment);
        if(employee.isValidInput()){
            employee.showDetails();
        }
        else{
            cout<<"Invalid input";
        }
        return 0;
        
    }