#include <iostream>
using namespace std;
class Base{
protected:
    int x;
    string s;
public:
    Base(int x, string s){
        this->x=x;
        this->s=s;
		cout<<"Constructor in the Base class"<<endl;
    }
	~Base(){
		cout<<"Destructor in the Base class"<<endl;
	}
    void setVar(int x, string s){
        this->x=x;
        this->s=s;
    }
    int getX(){return x;}
    string getS(){return s;}
};


class Derived : public Base{
private:
    int z;
public:
    Derived(int x, string s, int z): Base(x, s){
        this->z=z;
		cout<<"Constructor in the Derived class"<<endl;
    }
	~Derived(){
		cout<<"Destructor in the Derived class"<<endl;
	}
    void setVar(int z){
        this->z=z;
    }
    int getZ(){return z;}

    void display(){
        cout<<x<<" "<<s<<" "<<z<<endl;
    }
};


int main(){
    Derived d(5, "abc", 10);
    d.display();
    return 0;
}
