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

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

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

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

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

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

e.s = j
e.o = d
d.s = c
d.u = c
d.o = c
d.t = l
j.p = d
j.o = c
c.r = i
i.x = c
l.s = c
l.u = c
l.o = c
l.t = d
assert c.r.x.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

e.s = j
e.o = d
d.s = c
d.u = c
d.o = c
d.t = l
j.p = d
j.o = c
c.r = i
i.x = c
l.s = c
l.u = c
l.o = c
l.t = d
assert c.r.x.r.x.txt == "c"