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

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

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

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

k.w = e
b.v = a
b.x = n
a.w = d
a.r = c
a.s = l
e.w = l
e.r = m
e.s = d
f.v = e
f.x = d
d.v = e
d.x = n
l.v = e
l.x = d
n.v = a
n.x = f
m.w = a
c.w = a
assert b.x.v.s.x.v.s.x.x.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

k.w = e
b.v = a
b.x = n
a.w = d
a.r = c
a.s = l
e.w = l
e.r = m
e.s = d
f.v = e
f.x = d
d.v = e
d.x = n
l.v = e
l.x = d
n.v = a
n.x = f
m.w = a
c.w = a
assert b.x.v.s.x.v.s.x.x.v.w.txt == "l"