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

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
e = D("e")
m = E("m")
n = A("n")
a = C("a")
h = B("h")
j = A("j")

l.u = e
l.w = m
l.z = m
g.q = l
g.x = l
g.o = m
g.p = k
g.t = e
k.s = l
k.u = l
k.t = m
e.t = j
m.p = h
n.u = e
n.w = m
n.z = m
a.s = n
a.t = m
a.u = l
h.q = j
h.x = j
h.o = m
h.p = a
h.t = e
j.u = e
j.w = m
j.z = m
assert g.t.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: E = None
        self.z: E = None
        self.txt = txt

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
e = D("e")
m = E("m")
n = A("n")
a = C("a")
h = B("h")
j = A("j")

l.u = e
l.w = m
l.z = m
g.q = l
g.x = l
g.o = m
g.p = k
g.t = e
k.s = l
k.u = l
k.t = m
e.t = j
m.p = h
n.u = e
n.w = m
n.z = m
a.s = n
a.t = m
a.u = l
h.q = j
h.x = j
h.o = m
h.p = a
h.t = e
j.u = e
j.w = m
j.z = m
assert g.t.t.z.txt == "m"