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

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

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

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

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

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

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

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

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

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

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

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

e.t = h
e.o = h
e.r = a
e.s = m
l.t = e
l.q = h
k.z = e
c.p = m
c.r = h
m.q = e
m.x = i
m.z = i
m.p = a
a.z = h
h.t = e
h.o = e
h.r = a
h.s = m
g.p = m
g.r = e
i.p = m
i.r = e
j.p = m
j.r = e
assert m.p.z.s.txt == "m"