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

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

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

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

g.v = k
g.y = b
g.r = e
b.s = g
j.y = b
j.u = g
j.t = a
a.y = n
a.u = k
a.t = j
n.s = f
k.v = l
k.y = b
k.r = a
l.v = f
l.y = b
l.r = j
i.s = f
e.y = n
e.u = g
e.t = a
f.v = l
f.y = n
f.r = a
assert e.u.v.v.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.r: C = None
        self.txt = txt

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

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

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

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