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

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

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

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

n.v = h
n.y = h
n.x = m
a.x = m
m.t = b
c.x = m
h.x = b
j.v = a
j.y = c
j.x = i
i.t = b
k.v = c
k.y = c
k.x = m
e.x = b
b.t = i
assert n.y.x.t.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.y: B = None
        self.x: C = None
        self.txt = txt

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

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

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

n.v = h
n.y = h
n.x = m
a.x = m
m.t = b
c.x = m
h.x = b
j.v = a
j.y = c
j.x = i
i.t = b
k.v = c
k.y = c
k.x = m
e.x = b
b.t = i
assert n.y.x.t.t.t.t.t.t.t.txt == "i"