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

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

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

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

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

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

m.z = i
m.y = n
m.p = g
m.s = j
b.u = j
b.q = j
b.r = i
e.z = i
n.o = l
n.r = j
n.u = g
j.x = b
j.u = g
j.p = n
l.z = e
l.y = n
l.p = c
l.s = j
g.u = j
g.q = j
g.r = i
i.z = e
c.u = j
c.q = j
c.r = e
assert j.u.r.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.y: D = None
        self.p: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

m.z = i
m.y = n
m.p = g
m.s = j
b.u = j
b.q = j
b.r = i
e.z = i
n.o = l
n.r = j
n.u = g
j.x = b
j.u = g
j.p = n
l.z = e
l.y = n
l.p = c
l.s = j
g.u = j
g.q = j
g.r = i
i.z = e
c.u = j
c.q = j
c.r = e
assert j.u.r.z.z.z.z.z.txt == "e"