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

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

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

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

e = A("e")
j = B("j")
k = C("k")
l = D("l")
b = D("b")
a = B("a")
m = A("m")
d = B("d")

e.s = b
e.w = b
e.o = m
e.u = d
j.s = d
j.q = l
k.o = b
l.s = e
b.s = m
a.s = j
a.q = l
m.s = b
m.w = b
m.o = e
m.u = j
d.s = a
d.q = b
assert a.s.s.s.q.s.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: A = None
        self.u: B = None
        self.w: D = None
        self.txt = txt

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

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

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

e = A("e")
j = B("j")
k = C("k")
l = D("l")
b = D("b")
a = B("a")
m = A("m")
d = B("d")

e.s = b
e.w = b
e.o = m
e.u = d
j.s = d
j.q = l
k.o = b
l.s = e
b.s = m
a.s = j
a.q = l
m.s = b
m.w = b
m.o = e
m.u = j
d.s = a
d.q = b
assert a.s.s.s.q.s.o.u.txt == "j"