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

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

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

h = A("h")
n = B("n")
e = C("e")
k = B("k")

h.q = e
h.w = e
h.z = n
n.v = h
e.y = h
e.s = h
k.v = h
assert n.v.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.z: B = None
        self.txt = txt

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

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

h = A("h")
n = B("n")
e = C("e")
k = B("k")

h.q = e
h.w = e
h.z = n
n.v = h
e.y = h
e.s = h
k.v = h
assert n.v.w.y.txt == "h"