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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: E = None
        self.r: D = None
        self.y: D = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.t: A = None
        self.u: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: E = None
        self.r: D = None
        self.y: D = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.t: A = None
        self.u: I = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: G = None
        self.t: E = None
        self.z: B = None
        self.txt = txt

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

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