#include <iostream>

using namespace std;

class A{
public:
    int x, y, z;

    A() {
        this->x = 0;
        this->y = 0;
        this->z = 0;
    }

    void init (int x_in, int y_in, int z_in){
        this->x = x_in;
        this->y = y_in;
        this->z = z_in;
    }

    int sum(){
        return this->x + this->y + this->z;
    }

    void show_result() {
        int result = sum();
        cout << "sum = " << result << endl;
    }
};

class B {
public:
    A a;
    A b;

    B() {
        a.init(0, 1, 2);
        b.init(1, 2, 3);
    }
    void show_all_result() {
        a.show_result();
        b.show_result();
    }
};


int main() { 

    B obj_B;

    obj_B.show_all_result();
}
