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

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

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

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

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

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

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

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

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

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

e.x = a
e.w = i
e.y = m
m.w = a
m.u = i
i.v = f
i.w = a
i.y = b
b.s = m
b.o = m
a.v = b
a.w = i
a.y = f
f.s = m
f.o = m
assert e.y.u.w.v.s.txt == "m"