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

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

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

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

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

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

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

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

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

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

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