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

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

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

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

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

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

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

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

l.z = c
l.v = j
l.w = e
k.q = c
k.v = a
e.x = d
e.o = m
d.z = l
d.v = j
d.w = e
j.q = d
j.v = k
m.x = d
m.o = e
f.q = l
f.v = j
c.z = l
c.v = j
c.w = e
a.q = l
a.v = f
assert c.w.x.w.x.w.x.z.v.v.txt == "k"