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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: C = None
        self.y: B = None
        self.txt = txt

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

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