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

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

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

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

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

b = A("b")
l = B("l")
d = C("d")
i = D("i")
m = E("m")
e = C("e")
j = B("j")

b.s = i
l.s = b
l.u = e
l.o = i
d.r = j
d.y = e
d.s = e
d.z = i
i.z = e
i.r = e
m.y = l
e.r = l
e.y = d
e.s = d
e.z = i
j.s = b
j.u = e
j.o = i
assert i.r.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

b = A("b")
l = B("l")
d = C("d")
i = D("i")
m = E("m")
e = C("e")
j = B("j")

b.s = i
l.s = b
l.u = e
l.o = i
d.r = j
d.y = e
d.s = e
d.z = i
i.z = e
i.r = e
m.y = l
e.r = l
e.y = d
e.s = d
e.z = i
j.s = b
j.u = e
j.o = i
assert i.r.z.z.z.txt == "i"