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

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

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

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

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

e = A("e")
l = B("l")
i = C("i")
c = D("c")
m = E("m")

e.y = l
l.r = e
l.o = e
i.w = m
c.w = e
c.o = e
c.t = i
c.r = l
m.u = i
m.x = l
assert m.x.r.y.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

e = A("e")
l = B("l")
i = C("i")
c = D("c")
m = E("m")

e.y = l
l.r = e
l.o = e
i.w = m
c.w = e
c.o = e
c.t = i
c.r = l
m.u = i
m.x = l
assert m.x.r.y.o.txt == "e"