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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.o: B = None
        self.z: G = None
        self.p: C = None
        self.txt = txt

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

n.w = f
n.y = f
n.x = f
n.s = e
n.q = j
n.p = h
n.t = h
n.u = g
n.r = m
f.p = a
m.p = f
m.v = n
g.u = l
e.w = a
e.p = a
e.y = l
e.x = m
e.o = g
a.y = n
a.o = n
a.u = f
a.s = f
a.v = g
a.p = g
a.r = e
a.w = j
j.x = m
j.z = m
j.y = g
j.s = a
l.u = n
l.z = h
h.t = f
h.o = f
h.y = e
h.z = j
h.p = m
assert n.r.p.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: E = None
        self.q: G = None
        self.p: I = None
        self.u: D = None
        self.y: B = None
        self.x: B = None
        self.t: I = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.o: B = None
        self.z: G = None
        self.p: C = None
        self.txt = txt

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

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