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

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

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

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

k.x = b
h.v = l
h.w = b
e.z = h
e.x = h
e.t = f
b.v = g
b.w = h
f.z = b
f.x = b
f.t = m
g.z = h
g.x = h
g.t = m
d.x = b
m.z = h
m.x = h
m.t = e
l.z = b
l.x = b
l.t = m
assert f.z.v.x.w.v.t.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

k.x = b
h.v = l
h.w = b
e.z = h
e.x = h
e.t = f
b.v = g
b.w = h
f.z = b
f.x = b
f.t = m
g.z = h
g.x = h
g.t = m
d.x = b
m.z = h
m.x = h
m.t = e
l.z = b
l.x = b
l.t = m
assert f.z.v.x.w.v.t.x.v.txt == "l"