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

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

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

g = A("g")
m = B("m")
a = C("a")
d = A("d")
c = C("c")
n = B("n")
e = C("e")
j = C("j")
l = C("l")

g.v = d
g.p = d
g.z = n
m.t = l
a.y = d
a.v = d
a.s = m
d.v = g
d.p = g
d.z = n
c.y = g
c.v = g
c.s = n
n.t = a
e.y = d
e.v = d
e.s = m
j.y = d
j.v = d
j.s = n
l.y = d
l.v = d
l.s = n
assert l.y.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.z: B = None
        self.txt = txt

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

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

g = A("g")
m = B("m")
a = C("a")
d = A("d")
c = C("c")
n = B("n")
e = C("e")
j = C("j")
l = C("l")

g.v = d
g.p = d
g.z = n
m.t = l
a.y = d
a.v = d
a.s = m
d.v = g
d.p = g
d.z = n
c.y = g
c.v = g
c.s = n
n.t = a
e.y = d
e.v = d
e.s = m
j.y = d
j.v = d
j.s = n
l.y = d
l.v = d
l.s = n
assert l.y.z.t.txt == "a"