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

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

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

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

l.z = b
e.w = l
e.v = g
e.o = n
g.q = c
g.t = f
n.w = i
n.v = g
n.o = f
c.q = g
c.t = e
d.w = l
d.v = c
d.o = e
f.w = b
f.v = c
f.o = e
i.z = l
b.z = i
assert b.z.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

l.z = b
e.w = l
e.v = g
e.o = n
g.q = c
g.t = f
n.w = i
n.v = g
n.o = f
c.q = g
c.t = e
d.w = l
d.v = c
d.o = e
f.w = b
f.v = c
f.o = e
i.z = l
b.z = i
assert b.z.z.z.z.z.z.z.txt == "i"