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

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

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

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

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

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

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

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

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

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

j.w = l
j.s = d
j.o = m
j.p = h
m.x = j
m.s = b
m.q = a
m.z = a
n.s = h
a.o = l
a.u = l
a.t = m
a.y = d
b.x = h
b.s = m
b.q = l
b.z = l
l.o = a
l.u = a
l.t = b
l.y = n
e.s = h
h.w = a
h.s = n
h.o = b
h.p = j
d.s = h
assert j.o.s.z.txt == "l"