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

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

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

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

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

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

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

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

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