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

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

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

n = A("n")
m = B("m")
j = C("j")
k = C("k")
g = B("g")
d = A("d")
a = A("a")
c = A("c")
i = A("i")
b = C("b")

n.w = g
n.t = m
m.y = g
j.u = n
j.t = m
j.x = i
k.u = d
k.t = m
k.x = a
g.y = m
d.w = m
d.t = g
a.w = m
a.t = g
c.w = m
c.t = g
i.w = m
i.t = m
b.u = c
b.t = m
b.x = n
assert g.y.y.y.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
j = C("j")
k = C("k")
g = B("g")
d = A("d")
a = A("a")
c = A("c")
i = A("i")
b = C("b")

n.w = g
n.t = m
m.y = g
j.u = n
j.t = m
j.x = i
k.u = d
k.t = m
k.x = a
g.y = m
d.w = m
d.t = g
a.w = m
a.t = g
c.w = m
c.t = g
i.w = m
i.t = m
b.u = c
b.t = m
b.x = n
assert g.y.y.y.y.y.y.y.y.y.txt == "m"