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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: E = None
        self.o: H = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: E = None
        self.o: H = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

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