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

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

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

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

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

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

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

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

l.v = f
l.u = f
j.p = i
j.z = a
j.u = m
a.w = l
a.u = d
d.p = f
d.z = i
d.u = m
i.w = n
i.u = d
n.v = c
n.u = f
m.p = i
m.z = a
m.u = d
c.w = l
c.u = d
f.w = l
f.u = m
k.w = l
k.u = j
assert c.u.u.u.u.z.u.txt == "d"