class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.s: A = 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.x: B = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

k = A("k")
a = B("a")
g = C("g")
i = A("i")
f = C("f")
n = A("n")
m = A("m")
l = A("l")
e = B("e")
j = A("j")

k.r = f
k.t = m
k.s = n
a.x = f
g.x = a
g.v = a
g.u = f
i.r = f
i.t = k
i.s = m
f.x = a
f.v = e
f.u = g
n.r = g
n.t = k
n.s = j
m.r = f
m.t = j
m.s = k
l.r = g
l.t = k
l.s = m
e.x = g
j.r = g
j.t = n
j.s = l
assert j.s.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.s: A = 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.x: B = None
        self.v: B = None
        self.u: C = None
        self.txt = txt

k = A("k")
a = B("a")
g = C("g")
i = A("i")
f = C("f")
n = A("n")
m = A("m")
l = A("l")
e = B("e")
j = A("j")

k.r = f
k.t = m
k.s = n
a.x = f
g.x = a
g.v = a
g.u = f
i.r = f
i.t = k
i.s = m
f.x = a
f.v = e
f.u = g
n.r = g
n.t = k
n.s = j
m.r = f
m.t = j
m.s = k
l.r = g
l.t = k
l.s = m
e.x = g
j.r = g
j.t = n
j.s = l
assert j.s.t.t.txt == "m"