class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.s: G = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.o: F = None
        self.u: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: G = None
        self.txt = txt

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

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