class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

e = A("e")
i = B("i")
g = C("g")
l = D("l")

e.v = l
e.t = l
e.p = i
i.t = l
i.p = l
g.r = l
g.z = l
l.x = i
assert e.t.x.p.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: D = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

e = A("e")
i = B("i")
g = C("g")
l = D("l")

e.v = l
e.t = l
e.p = i
i.t = l
i.p = l
g.r = l
g.z = l
l.x = i
assert e.t.x.p.x.txt == "i"