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

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

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

n = A("n")
m = B("m")
e = C("e")
b = C("b")
c = A("c")
d = B("d")
j = A("j")
g = A("g")
f = A("f")

n.y = e
n.w = m
m.x = j
m.t = e
e.o = b
e.s = m
b.o = e
b.s = m
c.y = b
c.w = d
d.x = g
d.t = b
j.y = b
j.w = m
g.y = e
g.w = m
f.y = e
f.w = d
assert m.x.y.s.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: B = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
e = C("e")
b = C("b")
c = A("c")
d = B("d")
j = A("j")
g = A("g")
f = A("f")

n.y = e
n.w = m
m.x = j
m.t = e
e.o = b
e.s = m
b.o = e
b.s = m
c.y = b
c.w = d
d.x = g
d.t = b
j.y = b
j.w = m
g.y = e
g.w = m
f.y = e
f.w = d
assert m.x.y.s.t.o.txt == "b"