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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: C = None
        self.z: B = None
        self.txt = txt

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

j.y = l
l.z = j
l.s = e
g.o = a
g.r = e
g.z = k
i.z = j
i.s = g
a.z = j
a.s = g
k.z = n
k.s = b
e.o = i
e.r = b
e.z = f
b.o = k
b.r = g
b.z = a
f.z = n
f.s = e
n.y = a
assert l.z.y.s.o.s.txt == "g"