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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

n = A("n")
j = B("j")
b = C("b")
h = D("h")
i = C("i")
c = C("c")
f = A("f")
g = C("g")
l = D("l")
m = D("m")

n.t = g
n.y = f
n.u = i
j.p = m
b.z = m
b.s = g
b.p = i
h.s = l
h.w = b
i.z = l
i.s = g
i.p = c
c.z = l
c.s = i
c.p = i
f.t = i
f.u = i
f.y = n
g.z = m
g.s = c
g.p = c
l.s = h
l.w = i
m.s = h
m.w = b
assert h.s.w.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

n = A("n")
j = B("j")
b = C("b")
h = D("h")
i = C("i")
c = C("c")
f = A("f")
g = C("g")
l = D("l")
m = D("m")

n.t = g
n.y = f
n.u = i
j.p = m
b.z = m
b.s = g
b.p = i
h.s = l
h.w = b
i.z = l
i.s = g
i.p = c
c.z = l
c.s = i
c.p = i
f.t = i
f.u = i
f.y = n
g.z = m
g.s = c
g.p = c
l.s = h
l.w = i
m.s = h
m.w = b
assert h.s.w.z.s.txt == "h"