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

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

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

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

l.v = b
l.q = g
l.w = i
i.q = l
i.v = l
i.z = g
g.x = i
g.s = b
g.v = e
c.v = g
c.q = g
c.w = j
b.x = i
b.s = g
b.v = l
e.v = b
e.q = b
e.w = i
j.q = c
j.v = c
j.z = g
assert i.q.v.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.q: C = None
        self.w: B = None
        self.txt = txt

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

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

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

l.v = b
l.q = g
l.w = i
i.q = l
i.v = l
i.z = g
g.x = i
g.s = b
g.v = e
c.v = g
c.q = g
c.w = j
b.x = i
b.s = g
b.v = l
e.v = b
e.q = b
e.w = i
j.q = c
j.v = c
j.z = g
assert i.q.v.s.s.s.s.txt == "b"