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

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

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

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

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

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

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

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

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

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

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

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

j.o = d
j.z = l
j.y = a
b.w = l
d.w = a
a.x = l
a.o = n
a.r = n
a.q = j
l.y = j
l.q = j
l.u = a
l.s = a
l.t = b
n.w = a
assert b.w.s.q.txt == "j"