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

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

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

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

l.v = i
l.t = b
g.z = n
i.s = l
i.p = j
c.z = e
n.v = i
n.t = b
e.v = i
e.t = b
f.z = j
k.z = e
b.v = i
b.t = n
j.v = i
j.t = e
assert f.z.t.t.t.v.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: A = None
        self.txt = txt

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

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

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

l.v = i
l.t = b
g.z = n
i.s = l
i.p = j
c.z = e
n.v = i
n.t = b
e.v = i
e.t = b
f.z = j
k.z = e
b.v = i
b.t = n
j.v = i
j.t = e
assert f.z.t.t.t.v.s.t.txt == "b"