#include <iostream>
using namespace std;
class A{
int b;
public:
A(){
cout<<"Constructor for class A called\n";
b = 6;
}
~A(){
cout<<"Destructor called for class A\n";
}
};
class B{
A a;
public:
B(){
cout<<"Constructor for class B called\n";
}
~B(){
cout<<"Destructor called for class B\n";
}
};
int main(void){
B obj1;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIEF7CiAgICBpbnQgYjsKcHVibGljOgogICAgQSgpewogICAgICAgIGNvdXQ8PCJDb25zdHJ1Y3RvciBmb3IgY2xhc3MgQSBjYWxsZWRcbiI7CiAgICAgICAgYiA9IDY7CiAgICB9CiAgICB+QSgpewogICAgICAgIGNvdXQ8PCJEZXN0cnVjdG9yIGNhbGxlZCBmb3IgY2xhc3MgQVxuIjsKICAgIH0KfTsKCmNsYXNzIEJ7CiAgICBBIGE7CnB1YmxpYzoKICAgIEIoKXsKICAgICAgICBjb3V0PDwiQ29uc3RydWN0b3IgZm9yIGNsYXNzIEIgY2FsbGVkXG4iOwogICAgfQogICAgfkIoKXsKICAgICAgICBjb3V0PDwiRGVzdHJ1Y3RvciBjYWxsZWQgZm9yIGNsYXNzIEJcbiI7CiAgICB9Cn07CgoKaW50IG1haW4odm9pZCl7CiAgICBCIG9iajE7CiAgICByZXR1cm4gMDsKfQ==