class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: G = None
        self.t: G = None
        self.x: B = None
        self.y: B = None
        self.r: D = None
        self.p: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: H = None
        self.r: G = None
        self.u: G = None
        self.z: D = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.y: E = None
        self.w: B = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.p: D = None
        self.r: C = None
        self.o: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: B = None
        self.s: C = None
        self.q: A = None
        self.p: A = None
        self.r: A = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: G = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: H = None
        self.r: G = None
        self.u: G = None
        self.z: D = None
        self.x: D = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.y: E = None
        self.w: B = None
        self.v: A = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.p: D = None
        self.r: C = None
        self.o: B = None
        self.x: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: B = None
        self.s: C = None
        self.q: A = None
        self.p: A = None
        self.r: A = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: G = None
        self.s: B = None
        self.z: C = None
        self.txt = txt

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

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