class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: G = None
        self.w: C = None
        self.y: A = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.t: C = None
        self.s: F = None
        self.y: E = None
        self.o: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.u: G = None
        self.w: C = None
        self.y: A = None
        self.s: A = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.w: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.t: C = None
        self.s: F = None
        self.y: E = None
        self.o: G = None
        self.txt = txt

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

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