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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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