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

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

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

i = A("i")
g = B("g")
h = C("h")
b = C("b")
e = A("e")
d = A("d")

i.v = h
g.t = e
g.q = d
g.s = b
h.o = b
h.u = b
h.s = g
b.o = h
b.u = h
b.s = g
e.v = h
d.v = b
assert b.u.u.u.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

i = A("i")
g = B("g")
h = C("h")
b = C("b")
e = A("e")
d = A("d")

i.v = h
g.t = e
g.q = d
g.s = b
h.o = b
h.u = b
h.s = g
b.o = h
b.u = h
b.s = g
e.v = h
d.v = b
assert b.u.u.u.s.q.txt == "d"