class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: H = None
        self.x: I = None
        self.v: A = None
        self.z: A = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: F = None
        self.t: E = None
        self.w: D = None
        self.y: H = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: I = None
        self.r: I = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: B = None
        self.o: H = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.y: F = None
        self.z: H = None
        self.v: F = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.z: D = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: F = None
        self.s: D = None
        self.q: G = None
        self.o: E = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: F = None
        self.t: E = None
        self.w: D = None
        self.y: H = None
        self.s: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: I = None
        self.r: I = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: B = None
        self.o: H = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: A = None
        self.y: F = None
        self.z: H = None
        self.v: F = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.z: D = None
        self.q: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: F = None
        self.s: D = None
        self.q: G = None
        self.o: E = None
        self.t: D = None
        self.z: F = None
        self.txt = txt

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

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