class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

c.w = m
b.u = l
e.u = l
e.o = m
e.s = n
n.u = b
i.r = f
i.p = b
f.w = e
l.r = f
l.p = d
j.w = e
m.u = l
m.o = e
m.s = n
d.u = l
assert e.o.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

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

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

c.w = m
b.u = l
e.u = l
e.o = m
e.s = n
n.u = b
i.r = f
i.p = b
f.w = e
l.r = f
l.p = d
j.w = e
m.u = l
m.o = e
m.s = n
d.u = l
assert e.o.u.r.txt == "f"