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

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

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

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

d = A("d")
b = B("b")
j = C("j")
a = D("a")
e = D("e")
h = A("h")
i = C("i")
n = A("n")
k = B("k")

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

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

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

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

d = A("d")
b = B("b")
j = C("j")
a = D("a")
e = D("e")
h = A("h")
i = C("i")
n = A("n")
k = B("k")

d.z = h
d.t = b
b.o = k
b.p = j
b.w = j
j.t = n
j.u = h
j.s = e
j.w = i
a.w = n
a.q = e
a.z = e
e.w = n
e.q = a
e.z = a
h.z = d
h.t = b
i.t = d
i.u = n
i.s = a
i.w = j
n.z = h
n.t = b
k.o = b
k.p = i
k.w = j
assert j.s.w.z.z.t.o.o.o.txt == "k"