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

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

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

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

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

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

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

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

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

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

d.x = j
d.t = i
d.o = h
d.s = n
h.z = j
h.p = c
h.o = l
m.z = c
l.x = i
l.y = j
l.v = m
l.z = m
i.x = c
i.y = h
i.v = m
i.z = n
j.z = h
j.p = c
j.o = c
c.x = l
c.y = h
c.v = n
c.z = n
n.z = l
assert h.z.p.y.o.v.z.x.y.txt == "j"