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

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

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

k = A("k")
d = B("d")
n = C("n")
c = A("c")
j = B("j")
b = C("b")
l = C("l")
e = A("e")
f = B("f")

k.z = n
k.q = n
d.q = f
n.q = l
n.z = j
n.t = k
c.z = b
c.q = l
j.q = d
b.q = l
b.z = f
b.t = e
l.q = b
l.z = f
l.t = c
e.z = n
e.q = n
f.q = d
assert c.z.t.z.z.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.txt = txt

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

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

k = A("k")
d = B("d")
n = C("n")
c = A("c")
j = B("j")
b = C("b")
l = C("l")
e = A("e")
f = B("f")

k.z = n
k.q = n
d.q = f
n.q = l
n.z = j
n.t = k
c.z = b
c.q = l
j.q = d
b.q = l
b.z = f
b.t = e
l.q = b
l.z = f
l.t = c
e.z = n
e.q = n
f.q = d
assert c.z.t.z.z.q.q.q.txt == "d"