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

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

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

b = A("b")
e = B("e")
a = C("a")
d = B("d")
n = A("n")
m = B("m")
k = A("k")
j = B("j")
h = B("h")
c = C("c")

b.v = d
b.y = k
b.w = n
e.w = c
a.w = n
a.z = e
a.s = j
d.w = a
n.v = e
n.y = b
n.w = k
m.w = c
k.v = m
k.y = n
k.w = b
j.w = a
h.w = c
c.w = n
c.z = e
c.s = e
assert b.y.w.y.w.y.v.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: A = None
        self.w: A = None
        self.txt = txt

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

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

b = A("b")
e = B("e")
a = C("a")
d = B("d")
n = A("n")
m = B("m")
k = A("k")
j = B("j")
h = B("h")
c = C("c")

b.v = d
b.y = k
b.w = n
e.w = c
a.w = n
a.z = e
a.s = j
d.w = a
n.v = e
n.y = b
n.w = k
m.w = c
k.v = m
k.y = n
k.w = b
j.w = a
h.w = c
c.w = n
c.z = e
c.s = e
assert b.y.w.y.w.y.v.w.s.txt == "e"