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

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

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

m = A("m")
c = B("c")
k = C("k")
i = C("i")

m.s = k
c.v = k
c.z = k
c.o = k
k.q = c
i.q = c
assert i.q.z.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

m = A("m")
c = B("c")
k = C("k")
i = C("i")

m.s = k
c.v = k
c.z = k
c.o = k
k.q = c
i.q = c
assert i.q.z.q.o.txt == "k"