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

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

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

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

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

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

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

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

a.s = n
a.y = l
e.q = l
e.v = l
e.z = a
l.z = n
k.q = l
k.v = l
k.z = n
j.q = l
j.v = l
j.z = a
b.q = l
b.v = l
b.z = n
n.s = a
n.y = l
assert l.z.s.s.y.z.y.txt == "l"