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

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

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

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

e.s = a
e.p = f
e.v = m
b.y = f
b.r = k
b.z = a
f.w = h
f.z = k
l.s = a
l.p = f
l.v = h
h.s = a
h.p = f
h.v = l
m.s = a
m.p = f
m.v = e
k.w = h
k.z = f
a.y = f
a.r = f
a.z = b
assert l.p.w.s.y.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: C = None
        self.v: A = None
        self.txt = txt

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

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

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

e.s = a
e.p = f
e.v = m
b.y = f
b.r = k
b.z = a
f.w = h
f.z = k
l.s = a
l.p = f
l.v = h
h.s = a
h.p = f
h.v = l
m.s = a
m.p = f
m.v = e
k.w = h
k.z = f
a.y = f
a.r = f
a.z = b
assert l.p.w.s.y.z.z.txt == "f"