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

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

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

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

d.q = l
e.z = n
e.t = d
e.v = c
n.v = c
j.z = i
j.t = d
j.v = c
l.z = n
l.t = d
l.v = e
m.v = e
c.z = n
c.t = d
c.v = l
i.v = c
assert m.v.t.q.z.v.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

d.q = l
e.z = n
e.t = d
e.v = c
n.v = c
j.z = i
j.t = d
j.v = c
l.z = n
l.t = d
l.v = e
m.v = e
c.z = n
c.t = d
c.v = l
i.v = c
assert m.v.t.q.z.v.t.q.txt == "l"