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

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

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

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

l = A("l")
b = B("b")
i = C("i")
h = D("h")
d = C("d")
a = D("a")
e = C("e")

l.w = b
l.o = b
l.x = b
b.z = h
i.w = l
i.v = h
h.t = d
h.o = b
h.s = a
d.w = l
d.v = a
a.t = d
a.o = b
a.s = h
e.w = l
e.v = h
assert h.t.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.x: B = None
        self.txt = txt

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

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

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

l = A("l")
b = B("b")
i = C("i")
h = D("h")
d = C("d")
a = D("a")
e = C("e")

l.w = b
l.o = b
l.x = b
b.z = h
i.w = l
i.v = h
h.t = d
h.o = b
h.s = a
d.w = l
d.v = a
a.t = d
a.o = b
a.s = h
e.w = l
e.v = h
assert h.t.w.o.txt == "b"