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

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

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

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

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

g = A("g")
l = B("l")
m = C("m")
f = D("f")
e = E("e")
i = A("i")
d = D("d")
c = D("c")
j = E("j")

g.z = f
g.y = m
g.q = m
g.s = e
l.u = i
l.r = i
l.o = m
l.v = m
l.t = j
m.y = d
m.z = g
m.o = c
f.y = m
f.z = m
f.s = d
f.t = i
f.v = l
e.q = j
e.z = l
e.o = l
e.w = i
e.s = m
i.z = f
i.y = m
i.q = m
i.s = j
d.y = m
d.z = m
d.s = c
d.t = g
d.v = l
c.y = m
c.z = m
c.s = f
c.t = i
c.v = l
j.q = e
j.z = l
j.o = l
j.w = g
j.s = m
assert d.t.s.w.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: C = None
        self.q: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

g = A("g")
l = B("l")
m = C("m")
f = D("f")
e = E("e")
i = A("i")
d = D("d")
c = D("c")
j = E("j")

g.z = f
g.y = m
g.q = m
g.s = e
l.u = i
l.r = i
l.o = m
l.v = m
l.t = j
m.y = d
m.z = g
m.o = c
f.y = m
f.z = m
f.s = d
f.t = i
f.v = l
e.q = j
e.z = l
e.o = l
e.w = i
e.s = m
i.z = f
i.y = m
i.q = m
i.s = j
d.y = m
d.z = m
d.s = c
d.t = g
d.v = l
c.y = m
c.z = m
c.s = f
c.t = i
c.v = l
j.q = e
j.z = l
j.o = l
j.w = g
j.s = m
assert d.t.s.w.z.v.txt == "l"