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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: H = None
        self.q: A = None
        self.w: C = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: B = None
        self.w: I = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: H = None
        self.q: A = None
        self.w: C = None
        self.o: C = None
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: H = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: B = None
        self.w: I = None
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: B = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

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