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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.y: D = None
        self.t: F = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.s: B = None
        self.w: A = None
        self.txt = txt

n = A("n")
g = B("g")
m = C("m")
d = D("d")
e = E("e")
f = F("f")
a = E("a")
c = F("c")
h = C("h")
j = C("j")

n.v = f
g.r = h
g.s = e
g.y = d
g.t = f
g.v = m
m.z = j
d.z = g
e.s = m
f.v = h
f.u = a
f.s = g
f.w = n
a.s = j
c.v = h
c.u = a
c.s = g
c.w = n
h.z = m
j.z = m
assert c.u.s.z.z.z.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.y: D = None
        self.t: F = None
        self.v: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.u: E = None
        self.s: B = None
        self.w: A = None
        self.txt = txt

n = A("n")
g = B("g")
m = C("m")
d = D("d")
e = E("e")
f = F("f")
a = E("a")
c = F("c")
h = C("h")
j = C("j")

n.v = f
g.r = h
g.s = e
g.y = d
g.t = f
g.v = m
m.z = j
d.z = g
e.s = m
f.v = h
f.u = a
f.s = g
f.w = n
a.s = j
c.v = h
c.u = a
c.s = g
c.w = n
h.z = m
j.z = m
assert c.u.s.z.z.z.z.z.z.txt == "j"