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

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

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

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

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

d = A("d")
f = B("f")
m = C("m")
g = D("g")
k = E("k")
b = A("b")
e = C("e")
i = B("i")
l = E("l")

d.r = i
d.s = k
f.s = i
f.z = m
m.u = g
m.t = d
m.z = l
g.y = k
g.r = f
g.w = m
k.o = b
b.r = f
b.s = k
e.u = g
e.t = b
e.z = k
i.s = f
i.z = e
l.o = b
assert d.r.s.z.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

d = A("d")
f = B("f")
m = C("m")
g = D("g")
k = E("k")
b = A("b")
e = C("e")
i = B("i")
l = E("l")

d.r = i
d.s = k
f.s = i
f.z = m
m.u = g
m.t = d
m.z = l
g.y = k
g.r = f
g.w = m
k.o = b
b.r = f
b.s = k
e.u = g
e.t = b
e.z = k
i.s = f
i.z = e
l.o = b
assert d.r.s.z.z.o.txt == "b"