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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: F = None
        self.t: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: F = None
        self.t: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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