class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.v: H = None
        self.s: H = None
        self.p: B = None
        self.z: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: H = None
        self.z: D = None
        self.p: F = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: G = None
        self.t: A = None
        self.u: D = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: G = None
        self.w: B = None
        self.z: E = None
        self.t: G = None
        self.p: G = None
        self.u: H = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: C = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: H = None
        self.z: D = None
        self.p: F = None
        self.s: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: I = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: G = None
        self.t: A = None
        self.u: D = None
        self.o: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: G = None
        self.w: B = None
        self.z: E = None
        self.t: G = None
        self.p: G = None
        self.u: H = None
        self.txt = txt

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

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