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

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

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

m = A("m")
g = B("g")
a = C("a")
i = B("i")
b = A("b")
e = B("e")
l = C("l")
c = A("c")

m.q = l
m.o = b
m.t = a
g.s = e
a.v = m
a.z = l
a.s = i
i.s = g
b.q = a
b.t = a
b.o = m
e.s = i
l.v = b
l.z = a
l.s = g
c.q = l
c.o = b
c.t = a
assert l.s.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: A = None
        self.t: C = None
        self.txt = txt

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

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

m = A("m")
g = B("g")
a = C("a")
i = B("i")
b = A("b")
e = B("e")
l = C("l")
c = A("c")

m.q = l
m.o = b
m.t = a
g.s = e
a.v = m
a.z = l
a.s = i
i.s = g
b.q = a
b.t = a
b.o = m
e.s = i
l.v = b
l.z = a
l.s = g
c.q = l
c.o = b
c.t = a
assert l.s.s.s.s.s.txt == "e"