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

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

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

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

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

i = A("i")
j = B("j")
m = C("m")
n = D("n")
b = E("b")

i.q = m
i.x = b
i.y = n
j.s = n
j.v = m
m.v = b
m.o = b
m.t = i
m.q = n
m.s = n
n.t = j
n.z = j
n.o = j
n.u = m
b.o = j
b.s = j
b.w = j
b.y = j
assert m.o.s.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.y: D = None
        self.txt = txt

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

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

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

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

i = A("i")
j = B("j")
m = C("m")
n = D("n")
b = E("b")

i.q = m
i.x = b
i.y = n
j.s = n
j.v = m
m.v = b
m.o = b
m.t = i
m.q = n
m.s = n
n.t = j
n.z = j
n.o = j
n.u = m
b.o = j
b.s = j
b.w = j
b.y = j
assert m.o.s.s.o.txt == "j"