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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: E = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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