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

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

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

c = A("c")
i = B("i")
e = C("e")
n = B("n")
g = C("g")
l = C("l")

c.s = n
i.w = n
e.q = g
n.w = i
g.q = l
l.q = g
assert g.q.q.q.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

c = A("c")
i = B("i")
e = C("e")
n = B("n")
g = C("g")
l = C("l")

c.s = n
i.w = n
e.q = g
n.w = i
g.q = l
l.q = g
assert g.q.q.q.q.q.q.txt == "g"