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

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

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

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

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

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

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

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

h.v = e
j.q = f
f.w = d
f.x = c
f.t = j
e.w = d
e.x = c
e.t = i
c.w = l
c.x = f
c.t = i
i.q = f
l.v = f
g.q = c
b.v = c
d.v = e
assert c.w.v.w.v.w.v.txt == "e"