#include <iostream>
#include <string>

using namespace std;

class Person {
    private:
        string name {""};
        int age {0};
    public:
        Person() = default;
        Person(string name, int age) : name(name), age(age) {};
        string getName() {
            return name;
        }
        int getAge() {
            return age;
        }
};

class Student : public Person {
    private:
        int id {0};
        string major {""};
    public:
        Student() = default;
        Student(string name, int age, int id, string major) : Person(name, age), id(id), major(major) {};
        int getId() {
            return id;
        }
        string getMajor() {
            return major;
        }
};

class Faculty : public Person {
    private:
        string dept {""};
        string title {""};
    public:
        Faculty() = default;
        Faculty(string name, int age, string dept, string title) : Person(name, age), dept(dept), title(title) {};
        string getName() {
            if (title != "") {
                return title + " " + Person::getName();
            } else {
                return Person::getName();
            }
        }
        string getDept() {
            return dept;
        }
        string getTitle() {
            return title;
        }
};

int main() {

    Student student1 {"John", 18, 123, "Computer Science"};
    cout << student1.getName() << endl;
    cout << student1.getAge() << endl;

    Faculty faculty1 {"Paul", 42, "School of Computing", "Dr."};
    cout << faculty1.getName() << endl;
    cout << faculty1.getAge() << endl;

    Faculty faculty2 {"Ringo", 26, "School of Computing", ""};
    cout << faculty2.getName() << endl;
    cout << faculty2.getAge() << endl;
    
    return 0;

}