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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.q: C = None
        self.y: E = None
        self.x: F = None
        self.z: E = None
        self.w: I = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: I = None
        self.w: G = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.u: B = None
        self.x: E = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: C = None
        self.q: C = None
        self.y: E = None
        self.x: F = None
        self.z: E = None
        self.w: I = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: D = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: I = None
        self.w: G = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: I = None
        self.u: B = None
        self.x: E = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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