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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.y: E = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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

l.u = k
c.o = a
c.v = k
c.y = k
c.u = l
c.z = b
b.p = l
a.o = l
a.q = b
a.y = k
a.s = c
k.w = a
k.t = l
assert c.v.t.u.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: E = None
        self.y: E = None
        self.u: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: C = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

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

l.u = k
c.o = a
c.v = k
c.y = k
c.u = l
c.z = b
b.p = l
a.o = l
a.q = b
a.y = k
a.s = c
k.w = a
k.t = l
assert c.v.t.u.w.q.txt == "b"