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

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

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

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

e.o = h
e.z = k
e.x = k
k.t = e
k.v = e
h.v = k
h.r = k
h.s = k
assert k.v.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: B = None
        self.x: B = None
        self.txt = txt

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

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

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

e.o = h
e.z = k
e.x = k
k.t = e
k.v = e
h.v = k
h.r = k
h.s = k
assert k.v.o.s.txt == "k"