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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.t: A = None
        self.p: C = None
        self.v: C = None
        self.txt = txt

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

a = A("a")
j = B("j")
l = C("l")
c = D("c")
n = E("n")

a.v = l
a.q = c
a.r = c
j.s = n
l.o = j
l.v = j
l.u = j
l.t = a
l.w = n
c.x = j
c.z = n
c.t = a
c.p = l
c.v = l
n.q = a
assert c.x.s.q.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.t: A = None
        self.p: C = None
        self.v: C = None
        self.txt = txt

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

a = A("a")
j = B("j")
l = C("l")
c = D("c")
n = E("n")

a.v = l
a.q = c
a.r = c
j.s = n
l.o = j
l.v = j
l.u = j
l.t = a
l.w = n
c.x = j
c.z = n
c.t = a
c.p = l
c.v = l
n.q = a
assert c.x.s.q.v.w.txt == "n"