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

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

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

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

c = A("c")
n = B("n")
i = C("i")
h = D("h")
m = C("m")
e = B("e")
d = A("d")
j = B("j")

c.y = m
c.o = h
c.q = i
c.s = j
n.r = j
n.z = h
n.w = h
n.v = h
i.z = m
i.s = d
i.t = h
i.p = c
h.q = i
m.z = i
m.s = d
m.t = h
m.p = c
e.r = j
e.z = h
e.w = h
e.v = h
d.y = i
d.o = h
d.q = m
d.s = n
j.r = n
j.z = h
j.w = h
j.v = h
assert h.q.s.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: D = None
        self.q: C = None
        self.s: B = None
        self.txt = txt

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

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

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

c = A("c")
n = B("n")
i = C("i")
h = D("h")
m = C("m")
e = B("e")
d = A("d")
j = B("j")

c.y = m
c.o = h
c.q = i
c.s = j
n.r = j
n.z = h
n.w = h
n.v = h
i.z = m
i.s = d
i.t = h
i.p = c
h.q = i
m.z = i
m.s = d
m.t = h
m.p = c
e.r = j
e.z = h
e.w = h
e.v = h
d.y = i
d.o = h
d.q = m
d.s = n
j.r = n
j.z = h
j.w = h
j.v = h
assert h.q.s.q.s.txt == "d"