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

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

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

m = A("m")
n = B("n")
j = C("j")
k = C("k")
h = B("h")

m.z = n
n.y = h
j.t = k
k.t = j
h.y = n
assert h.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

m = A("m")
n = B("n")
j = C("j")
k = C("k")
h = B("h")

m.z = n
n.y = h
j.t = k
k.t = j
h.y = n
assert h.y.y.y.y.txt == "h"