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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.x: A = None
        self.y: C = None
        self.u: A = 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.p: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: C = None
        self.x: A = None
        self.y: C = None
        self.u: A = 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.p: B = None
        self.txt = txt

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

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

m.r = h
m.z = h
m.x = g
m.s = j
m.p = j
j.v = g
j.s = h
j.y = h
j.x = c
j.u = m
h.z = i
g.p = j
a.r = j
a.o = j
a.q = m
a.v = m
a.x = i
l.r = i
l.z = i
l.x = g
l.s = j
l.p = j
c.r = h
c.z = h
c.x = g
c.s = j
c.p = j
i.z = h
assert a.r.v.p.x.z.z.txt == "i"