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

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

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

d = A("d")
l = B("l")
k = C("k")
e = C("e")
c = B("c")
i = B("i")
g = A("g")
n = B("n")

d.t = e
d.x = e
l.q = g
l.z = n
k.z = e
k.x = g
k.v = c
e.z = k
e.x = d
e.v = n
c.q = g
c.z = n
i.q = d
i.z = n
g.t = k
g.x = e
n.q = g
n.z = l
assert d.t.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: C = None
        self.txt = txt

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

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

d = A("d")
l = B("l")
k = C("k")
e = C("e")
c = B("c")
i = B("i")
g = A("g")
n = B("n")

d.t = e
d.x = e
l.q = g
l.z = n
k.z = e
k.x = g
k.v = c
e.z = k
e.x = d
e.v = n
c.q = g
c.z = n
i.q = d
i.z = n
g.t = k
g.x = e
n.q = g
n.z = l
assert d.t.z.z.z.txt == "k"