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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.q: E = None
        self.w: A = None
        self.y: A = None
        self.txt = txt

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

i = A("i")
e = B("e")
b = C("b")
j = D("j")
c = E("c")
h = B("h")
m = E("m")

i.o = c
e.p = b
e.s = h
e.x = m
b.r = j
b.x = j
j.z = i
j.w = i
j.y = i
j.v = h
j.q = m
c.s = b
c.y = b
c.z = e
c.v = j
h.p = b
h.s = e
h.x = m
m.s = b
m.y = b
m.z = e
m.v = j
assert m.v.z.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: B = None
        self.q: E = None
        self.w: A = None
        self.y: A = None
        self.txt = txt

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

i = A("i")
e = B("e")
b = C("b")
j = D("j")
c = E("c")
h = B("h")
m = E("m")

i.o = c
e.p = b
e.s = h
e.x = m
b.r = j
b.x = j
j.z = i
j.w = i
j.y = i
j.v = h
j.q = m
c.s = b
c.y = b
c.z = e
c.v = j
h.p = b
h.s = e
h.x = m
m.s = b
m.y = b
m.z = e
m.v = j
assert m.v.z.o.z.txt == "e"