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

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

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

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

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

b = A("b")
l = B("l")
h = C("h")
a = D("a")
c = E("c")

b.w = h
b.v = h
l.y = h
h.t = a
h.r = a
h.q = c
h.x = l
a.w = h
a.v = h
a.u = l
a.s = l
a.x = b
c.v = l
c.t = b
assert c.t.v.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
h = C("h")
a = D("a")
c = E("c")

b.w = h
b.v = h
l.y = h
h.t = a
h.r = a
h.q = c
h.x = l
a.w = h
a.v = h
a.u = l
a.s = l
a.x = b
c.v = l
c.t = b
assert c.t.v.q.t.txt == "b"