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

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

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

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

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

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

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

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

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

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

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

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

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