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

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

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

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

f.v = e
a.p = m
a.v = m
a.t = c
l.z = c
e.v = f
k.z = b
m.p = h
m.t = c
m.v = b
h.p = m
h.v = m
h.t = a
b.p = m
b.t = m
b.v = m
c.p = m
c.t = h
c.v = b
n.v = e
assert e.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

f.v = e
a.p = m
a.v = m
a.t = c
l.z = c
e.v = f
k.z = b
m.p = h
m.t = c
m.v = b
h.p = m
h.v = m
h.t = a
b.p = m
b.t = m
b.v = m
c.p = m
c.t = h
c.v = b
n.v = e
assert e.v.v.v.v.v.txt == "f"