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

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

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

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

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

h.z = j
h.q = j
h.s = g
n.t = g
n.r = b
n.p = j
a.v = d
a.y = d
d.s = a
d.o = h
d.t = g
g.s = a
g.o = b
g.t = d
i.v = g
i.y = d
f.v = d
f.y = d
j.t = d
j.r = h
j.p = n
b.z = j
b.s = g
b.q = n
assert h.q.p.t.s.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

h.z = j
h.q = j
h.s = g
n.t = g
n.r = b
n.p = j
a.v = d
a.y = d
d.s = a
d.o = h
d.t = g
g.s = a
g.o = b
g.t = d
i.v = g
i.y = d
f.v = d
f.y = d
j.t = d
j.r = h
j.p = n
b.z = j
b.s = g
b.q = n
assert h.q.p.t.s.v.s.txt == "a"