class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: B = None
        self.u: G = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: I = None
        self.r: B = None
        self.x: B = None
        self.w: G = None
        self.v: I = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: I = None
        self.r: B = None
        self.x: B = None
        self.w: G = None
        self.v: I = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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