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

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

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

g = A("g")
j = B("j")
l = C("l")
b = A("b")
f = B("f")
k = B("k")
c = C("c")

g.q = l
g.z = l
g.t = f
j.r = k
j.u = l
j.z = c
l.z = b
b.q = c
b.z = c
b.t = f
f.r = j
f.u = l
f.z = l
k.r = f
k.u = c
k.z = l
c.z = b
assert l.z.q.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

g = A("g")
j = B("j")
l = C("l")
b = A("b")
f = B("f")
k = B("k")
c = C("c")

g.q = l
g.z = l
g.t = f
j.r = k
j.u = l
j.z = c
l.z = b
b.q = c
b.z = c
b.t = f
f.r = j
f.u = l
f.z = l
k.r = f
k.u = c
k.z = l
c.z = b
assert l.z.q.z.z.z.txt == "b"