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

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

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

l = A("l")
k = B("k")
d = C("d")
e = A("e")
g = A("g")
a = C("a")
m = C("m")
i = C("i")
h = C("h")
j = C("j")

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

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

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

l = A("l")
k = B("k")
d = C("d")
e = A("e")
g = A("g")
a = C("a")
m = C("m")
i = C("i")
h = C("h")
j = C("j")

l.v = e
k.u = h
k.t = j
k.p = g
d.q = h
d.z = k
e.v = g
g.v = e
a.q = i
a.z = k
m.q = h
m.z = k
i.q = d
i.z = k
h.q = a
h.z = k
j.q = a
j.z = k
assert i.z.p.v.v.v.txt == "e"