#include <iostream>
using namespace std;

class three_d {
    int x, y, z;
public:
    three_d(int a, int b, int c) {x=a; y=b, z=c; }
    const three_d& operator+(three_d op2);
    friend ostream &operator<<(ostream &stream, const three_d &obj);
};
ostream &operator<< (ostream &stream, const three_d &obj)
{
    stream << obj.x << ", ";
    stream << obj.y << ", ";
    stream << obj.z << endl;
    return stream;
}
const three_d& three_d::operator+ (three_d op2)
{
    return three_d(x + op2.x, y + op2.y, z + op2.z);
}

int main()
{
    three_d a(1, 2, 3), b(2, 3, 4);
    cout << a+b << endl; // 32
    return 0;
}