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

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

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

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

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

n = A("n")
e = B("e")
b = C("b")
d = D("d")
l = E("l")

n.r = l
e.x = n
e.p = n
e.t = n
e.o = l
b.u = n
b.q = l
b.w = l
b.s = e
b.o = e
d.x = e
d.r = n
d.w = n
l.s = d
l.y = n
assert n.r.s.x.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

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

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

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

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

n = A("n")
e = B("e")
b = C("b")
d = D("d")
l = E("l")

n.r = l
e.x = n
e.p = n
e.t = n
e.o = l
b.u = n
b.q = l
b.w = l
b.s = e
b.o = e
d.x = e
d.r = n
d.w = n
l.s = d
l.y = n
assert n.r.s.x.t.r.txt == "l"