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

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

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

a = A("a")
k = B("k")
f = C("f")
n = B("n")
m = C("m")
i = C("i")
e = C("e")
j = C("j")
d = C("d")
l = B("l")

a.p = m
a.v = m
a.y = f
k.s = a
k.w = a
k.y = a
f.u = e
n.s = a
n.w = a
n.y = a
m.u = d
i.u = m
e.u = j
j.u = e
d.u = i
l.s = a
l.w = a
l.y = a
assert m.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: C = None
        self.y: C = None
        self.txt = txt

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

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

a = A("a")
k = B("k")
f = C("f")
n = B("n")
m = C("m")
i = C("i")
e = C("e")
j = C("j")
d = C("d")
l = B("l")

a.p = m
a.v = m
a.y = f
k.s = a
k.w = a
k.y = a
f.u = e
n.s = a
n.w = a
n.y = a
m.u = d
i.u = m
e.u = j
j.u = e
d.u = i
l.s = a
l.w = a
l.y = a
assert m.u.u.u.txt == "m"