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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: G = None
        self.r: A = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.v: G = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.o: A = None
        self.x: I = None
        self.u: I = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: H = None
        self.x: I = None
        self.v: F = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
l = C("l")
k = D("k")
e = E("e")
g = F("g")
a = G("a")
b = H("b")
m = I("m")

n.s = m
n.r = a
n.u = b
n.o = b
n.w = g
n.z = e
n.v = e
h.v = n
h.u = n
h.w = g
h.z = a
h.o = k
h.q = k
h.x = e
l.w = e
l.o = a
l.p = a
l.r = n
k.u = h
k.w = h
e.x = g
e.u = g
e.v = a
e.w = b
g.z = h
g.q = h
g.w = n
g.o = n
g.x = m
g.u = m
g.p = l
a.r = l
a.y = b
a.x = m
a.v = g
b.w = e
b.q = m
b.p = g
m.v = e
m.r = l
m.s = l
m.u = n
m.x = b
m.y = k
assert m.x.w.u.u.u.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.s: I = None
        self.r: G = None
        self.u: H = None
        self.o: H = None
        self.w: F = None
        self.z: E = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: G = None
        self.r: A = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: F = None
        self.v: G = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.w: A = None
        self.o: A = None
        self.x: I = None
        self.u: I = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: H = None
        self.x: I = None
        self.v: F = None
        self.txt = txt

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

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

n = A("n")
h = B("h")
l = C("l")
k = D("k")
e = E("e")
g = F("g")
a = G("a")
b = H("b")
m = I("m")

n.s = m
n.r = a
n.u = b
n.o = b
n.w = g
n.z = e
n.v = e
h.v = n
h.u = n
h.w = g
h.z = a
h.o = k
h.q = k
h.x = e
l.w = e
l.o = a
l.p = a
l.r = n
k.u = h
k.w = h
e.x = g
e.u = g
e.v = a
e.w = b
g.z = h
g.q = h
g.w = n
g.o = n
g.x = m
g.u = m
g.p = l
a.r = l
a.y = b
a.x = m
a.v = g
b.w = e
b.q = m
b.p = g
m.v = e
m.r = l
m.s = l
m.u = n
m.x = b
m.y = k
assert m.x.w.u.u.u.r.x.txt == "m"