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

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

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

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

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

b = A("b")
f = B("f")
l = C("l")
n = D("n")
m = E("m")
i = D("i")
e = E("e")

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

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

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

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

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

b = A("b")
f = B("f")
l = C("l")
n = D("n")
m = E("m")
i = D("i")
e = E("e")

b.s = n
b.t = e
f.s = i
l.z = n
l.o = i
n.r = i
n.t = f
n.u = m
m.r = e
m.w = b
m.o = f
i.r = n
i.t = f
i.u = m
e.r = m
e.w = b
e.o = f
assert i.t.s.u.w.s.r.txt == "i"