class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

e = A("e")
a = B("a")
m = C("m")
i = D("i")

e.y = a
a.y = m
a.u = m
a.r = m
m.x = a
m.v = i
m.t = i
i.t = m
i.o = m
i.w = m
assert m.v.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: C = None
        self.r: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.w: C = None
        self.txt = txt

e = A("e")
a = B("a")
m = C("m")
i = D("i")

e.y = a
a.y = m
a.u = m
a.r = m
m.x = a
m.v = i
m.t = i
i.t = m
i.o = m
i.w = m
assert m.v.o.x.txt == "a"