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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: C = None
        self.x: D = None
        self.v: E = None
        self.y: C = None
        self.txt = txt

l = A("l")
c = B("c")
d = C("d")
e = D("e")
g = E("g")
m = E("m")
a = B("a")
b = C("b")

l.t = m
c.y = l
c.w = l
d.z = l
d.y = l
d.o = e
d.q = e
d.x = b
e.p = g
e.o = g
e.s = l
e.t = c
g.w = a
g.t = d
g.x = e
g.v = m
g.y = b
m.w = a
m.t = d
m.y = d
m.x = e
m.v = g
a.y = l
a.w = l
b.z = l
b.y = l
b.o = e
b.q = e
b.x = d
assert m.y.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: C = None
        self.x: D = None
        self.v: E = None
        self.y: C = None
        self.txt = txt

l = A("l")
c = B("c")
d = C("d")
e = D("e")
g = E("g")
m = E("m")
a = B("a")
b = C("b")

l.t = m
c.y = l
c.w = l
d.z = l
d.y = l
d.o = e
d.q = e
d.x = b
e.p = g
e.o = g
e.s = l
e.t = c
g.w = a
g.t = d
g.x = e
g.v = m
g.y = b
m.w = a
m.t = d
m.y = d
m.x = e
m.v = g
a.y = l
a.w = l
b.z = l
b.y = l
b.o = e
b.q = e
b.x = d
assert m.y.y.t.txt == "m"