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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.p: B = None
        self.u: F = None
        self.o: G = None
        self.z: G = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.v: D = None
        self.q: C = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.p: C = None
        self.u: I = None
        self.t: D = None
        self.o: D = None
        self.v: B = None
        self.r: B = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.txt = txt

n = A("n")
h = B("h")
d = C("d")
k = D("k")
b = E("b")
a = F("a")
l = G("l")
g = H("g")
e = I("e")

n.v = b
h.x = a
h.w = e
d.w = k
d.t = b
d.y = b
d.p = h
d.u = a
d.o = l
d.z = l
k.t = h
b.p = e
b.w = h
b.x = a
a.y = g
a.p = h
a.v = k
a.q = d
a.r = l
a.u = l
l.s = a
l.x = n
l.p = d
l.u = e
l.t = k
l.o = k
l.w = k
l.v = h
l.r = h
g.x = h
g.r = b
e.t = k
e.u = d
assert a.u.v.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: E = None
        self.p: B = None
        self.u: F = None
        self.o: G = None
        self.z: G = None
        self.y: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: B = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: B = None
        self.v: D = None
        self.q: C = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: A = None
        self.p: C = None
        self.u: I = None
        self.t: D = None
        self.o: D = None
        self.v: B = None
        self.r: B = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.txt = txt

n = A("n")
h = B("h")
d = C("d")
k = D("k")
b = E("b")
a = F("a")
l = G("l")
g = H("g")
e = I("e")

n.v = b
h.x = a
h.w = e
d.w = k
d.t = b
d.y = b
d.p = h
d.u = a
d.o = l
d.z = l
k.t = h
b.p = e
b.w = h
b.x = a
a.y = g
a.p = h
a.v = k
a.q = d
a.r = l
a.u = l
l.s = a
l.x = n
l.p = d
l.u = e
l.t = k
l.o = k
l.w = k
l.v = h
l.r = h
g.x = h
g.r = b
e.t = k
e.u = d
assert a.u.v.x.v.txt == "k"