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

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

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

j = A("j")
l = B("l")
k = C("k")
b = A("b")
i = B("i")
h = B("h")
f = B("f")

j.v = k
j.w = k
j.q = k
l.x = k
l.p = k
l.z = f
k.s = i
b.v = k
b.w = k
b.q = k
i.x = k
i.p = k
i.z = h
h.x = k
h.p = k
h.z = i
f.x = k
f.p = k
f.z = l
assert h.z.x.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: C = None
        self.q: C = None
        self.txt = txt

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

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

j = A("j")
l = B("l")
k = C("k")
b = A("b")
i = B("i")
h = B("h")
f = B("f")

j.v = k
j.w = k
j.q = k
l.x = k
l.p = k
l.z = f
k.s = i
b.v = k
b.w = k
b.q = k
i.x = k
i.p = k
i.z = h
h.x = k
h.p = k
h.z = i
f.x = k
f.p = k
f.z = l
assert h.z.x.s.p.txt == "k"