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

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

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

h = A("h")
k = B("k")
g = C("g")
e = C("e")
b = C("b")
n = C("n")
c = A("c")
a = C("a")
i = C("i")
m = C("m")

h.t = n
k.w = n
k.y = c
k.o = i
g.z = k
g.r = k
g.w = k
e.z = k
e.r = k
e.w = k
b.z = k
b.r = k
b.w = k
n.z = k
n.r = k
n.w = k
c.t = e
a.z = k
a.r = k
a.w = k
i.z = k
i.r = k
i.w = k
m.z = k
m.r = k
m.w = k
assert k.w.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

h = A("h")
k = B("k")
g = C("g")
e = C("e")
b = C("b")
n = C("n")
c = A("c")
a = C("a")
i = C("i")
m = C("m")

h.t = n
k.w = n
k.y = c
k.o = i
g.z = k
g.r = k
g.w = k
e.z = k
e.r = k
e.w = k
b.z = k
b.r = k
b.w = k
n.z = k
n.r = k
n.w = k
c.t = e
a.z = k
a.r = k
a.w = k
i.z = k
i.r = k
i.w = k
m.z = k
m.r = k
m.w = k
assert k.w.w.o.txt == "i"