#include <iostream>
#include <vector>

struct Vector3d { int x = 0; int y = 0; int z = 0;};
class Position:public Vector3d {};
class Velocity:public Vector3d {};

class Trajectory:public Position, public Velocity
{
public:
    Vector3d &GetPosition() { return static_cast<Position&>(*this); }
    Vector3d &GetVelocity() { return static_cast<Velocity&>(*this); }
};

std::ostream& operator << (std::ostream& os, const Vector3d & v)
{
    return os << '{' << v.x << ',' << v.y << ',' << v.z << ',' << '}';   
}


int main()
{
    Trajectory t;
    
    t.GetPosition() = {1, 2, 3};
    t.GetVelocity() = {4, 5, 6};

    std::cout << t.GetPosition() << t.GetVelocity() << std::endl;
}
