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

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

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

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

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

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

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

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

k.v = f
n.x = a
d.s = a
d.u = a
j.s = n
j.u = n
a.x = l
l.x = n
m.v = e
g.v = f
f.v = e
e.v = m
assert a.x.x.x.x.x.x.x.txt == "l"