#include <iostream>
class B{
public:
    B(int xx, int yy): x(xx), y(yy){}
    B& operator+(B& d){
        x+=d.x;
        y+=d.y;
        return *this;
    }
private:
    int x;
    int y;
};
class A{
public:
    A(int xx, int yy): x(xx), y(yy){}
    operator B() {
        return B(x,y);
    }
    operator int() {
        return x;
    }

private:
    int x;
    int y;
};

int main() {
    A a(4 ,5);
    B b(3,2);
    static_cast<B>(a) + b;
    return 0;
}