class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.z: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: A = None
        self.w: F = None
        self.u: H = None
        self.y: H = None
        self.v: A = None
        self.o: G = None
        self.t: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: A = None
        self.w: F = None
        self.u: H = None
        self.y: H = None
        self.v: A = None
        self.o: G = None
        self.t: H = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.txt = txt

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

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

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

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