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

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

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

k = A("k")
j = B("j")
e = C("e")
d = C("d")
l = C("l")
f = A("f")
a = B("a")

k.w = l
k.q = a
k.y = j
j.q = d
e.z = a
e.s = d
e.x = d
d.z = j
d.s = e
d.x = e
l.z = a
l.s = e
l.x = d
f.w = e
f.q = a
f.y = j
a.q = e
assert l.z.q.z.q.z.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: B = None
        self.y: B = None
        self.txt = txt

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

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

k = A("k")
j = B("j")
e = C("e")
d = C("d")
l = C("l")
f = A("f")
a = B("a")

k.w = l
k.q = a
k.y = j
j.q = d
e.z = a
e.s = d
e.x = d
d.z = j
d.s = e
d.x = e
l.z = a
l.s = e
l.x = d
f.w = e
f.q = a
f.y = j
a.q = e
assert l.z.q.z.q.z.q.z.txt == "a"