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

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

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

a = A("a")
d = B("d")
k = C("k")
g = B("g")
e = C("e")
c = A("c")
j = B("j")

a.v = d
d.w = e
d.s = e
d.q = g
k.u = c
k.y = j
g.w = e
g.s = e
g.q = j
e.u = a
e.y = d
c.v = g
j.w = k
j.s = e
j.q = g
assert g.q.q.w.y.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

a = A("a")
d = B("d")
k = C("k")
g = B("g")
e = C("e")
c = A("c")
j = B("j")

a.v = d
d.w = e
d.s = e
d.q = g
k.u = c
k.y = j
g.w = e
g.s = e
g.q = j
e.u = a
e.y = d
c.v = g
j.w = k
j.s = e
j.q = g
assert g.q.q.w.y.s.u.txt == "a"