class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: G = None
        self.u: C = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.q: E = None
        self.y: G = None
        self.w: H = None
        self.z: E = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: G = None
        self.v: G = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: F = None
        self.txt = txt

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

n = A("n")
g = B("g")
k = C("k")
f = D("f")
e = E("e")
i = F("i")
b = G("b")
d = H("d")
h = H("h")
m = B("m")

n.v = f
n.t = b
n.u = k
n.p = g
n.z = m
g.u = e
g.q = e
g.z = e
g.v = e
g.t = i
g.y = b
g.w = h
g.p = m
k.z = e
k.v = f
f.z = i
f.o = b
f.v = b
f.t = b
f.u = k
e.u = h
e.t = d
i.v = k
i.w = d
i.t = b
i.y = b
i.q = b
i.u = f
i.z = f
i.o = g
b.s = d
b.x = i
d.v = e
h.v = e
m.u = e
m.q = e
m.z = e
m.v = e
m.t = i
m.y = b
m.w = h
m.p = g
assert m.z.u.v.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: G = None
        self.u: C = None
        self.p: B = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.t: F = None
        self.q: E = None
        self.y: G = None
        self.w: H = None
        self.z: E = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.o: G = None
        self.v: G = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.t: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: F = None
        self.txt = txt

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

n = A("n")
g = B("g")
k = C("k")
f = D("f")
e = E("e")
i = F("i")
b = G("b")
d = H("d")
h = H("h")
m = B("m")

n.v = f
n.t = b
n.u = k
n.p = g
n.z = m
g.u = e
g.q = e
g.z = e
g.v = e
g.t = i
g.y = b
g.w = h
g.p = m
k.z = e
k.v = f
f.z = i
f.o = b
f.v = b
f.t = b
f.u = k
e.u = h
e.t = d
i.v = k
i.w = d
i.t = b
i.y = b
i.q = b
i.u = f
i.z = f
i.o = g
b.s = d
b.x = i
d.v = e
h.v = e
m.u = e
m.q = e
m.z = e
m.v = e
m.t = i
m.y = b
m.w = h
m.p = g
assert m.z.u.v.t.v.t.txt == "d"