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

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

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

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

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

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

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

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

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

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

e.o = j
e.t = l
e.w = d
d.o = j
j.o = e
j.u = d
j.w = f
l.t = j
l.x = f
l.w = d
l.s = e
f.o = e
f.u = d
f.w = j
assert l.t.o.w.o.o.txt == "e"