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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: E = None
        self.s: C = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

b = A("b")
i = B("i")
h = C("h")
j = D("j")
l = E("l")
e = E("e")

b.v = j
i.u = b
h.t = i
h.u = j
j.z = i
l.o = h
l.s = h
l.u = h
l.q = e
l.x = i
e.o = h
e.s = h
e.u = h
e.q = l
e.x = i
assert l.o.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: E = None
        self.s: C = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

b = A("b")
i = B("i")
h = C("h")
j = D("j")
l = E("l")
e = E("e")

b.v = j
i.u = b
h.t = i
h.u = j
j.z = i
l.o = h
l.s = h
l.u = h
l.q = e
l.x = i
e.o = h
e.s = h
e.u = h
e.q = l
e.x = i
assert l.o.t.u.txt == "b"