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

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

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

k = A("k")
h = B("h")
e = C("e")
d = C("d")
m = B("m")
b = C("b")
i = C("i")
l = B("l")
n = A("n")
f = B("f")

k.v = i
k.u = e
k.t = n
h.z = i
e.w = d
e.r = b
e.z = b
d.w = i
d.z = i
d.r = e
m.z = d
b.w = d
b.r = e
b.z = e
i.w = d
i.r = d
i.z = e
l.z = d
n.v = b
n.u = i
n.t = k
f.z = e
assert n.v.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: C = None
        self.t: A = None
        self.txt = txt

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

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

k = A("k")
h = B("h")
e = C("e")
d = C("d")
m = B("m")
b = C("b")
i = C("i")
l = B("l")
n = A("n")
f = B("f")

k.v = i
k.u = e
k.t = n
h.z = i
e.w = d
e.r = b
e.z = b
d.w = i
d.z = i
d.r = e
m.z = d
b.w = d
b.r = e
b.z = e
i.w = d
i.r = d
i.z = e
l.z = d
n.v = b
n.u = i
n.t = k
f.z = e
assert n.v.w.z.txt == "i"