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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.t: B = None
        self.x: I = None
        self.w: E = None
        self.z: D = None
        self.v: H = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: H = None
        self.s: F = None
        self.r: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.t: B = None
        self.x: I = None
        self.w: E = None
        self.z: D = None
        self.v: H = None
        self.q: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: H = None
        self.s: F = None
        self.r: F = None
        self.q: B = None
        self.txt = txt

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

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