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

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

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

c = A("c")
h = B("h")
a = C("a")
k = C("k")
e = C("e")
j = C("j")
m = C("m")
i = B("i")
f = C("f")
g = A("g")

c.z = h
h.x = i
h.q = i
h.z = k
a.v = i
a.p = g
a.t = h
k.v = h
k.t = h
k.p = g
e.v = i
e.p = g
e.t = h
j.v = i
j.p = g
j.t = h
m.v = i
m.p = c
m.t = h
i.x = h
i.q = h
i.z = j
f.v = i
f.t = i
f.p = g
g.z = h
assert i.z.p.z.q.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

c = A("c")
h = B("h")
a = C("a")
k = C("k")
e = C("e")
j = C("j")
m = C("m")
i = B("i")
f = C("f")
g = A("g")

c.z = h
h.x = i
h.q = i
h.z = k
a.v = i
a.p = g
a.t = h
k.v = h
k.t = h
k.p = g
e.v = i
e.p = g
e.t = h
j.v = i
j.p = g
j.t = h
m.v = i
m.p = c
m.t = h
i.x = h
i.q = h
i.z = j
f.v = i
f.t = i
f.p = g
g.z = h
assert i.z.p.z.q.z.t.txt == "h"