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

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

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

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

i = A("i")
e = B("e")
f = C("f")
l = D("l")
j = C("j")

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

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

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

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

i = A("i")
e = B("e")
f = C("f")
l = D("l")
j = C("j")

i.t = e
i.w = e
e.r = l
f.y = e
f.s = e
f.x = l
f.u = l
l.o = i
j.y = e
j.s = e
j.x = l
j.u = l
assert l.o.t.r.o.t.txt == "e"