class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.s: A = None
        self.w: A = None
        self.p: I = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: E = None
        self.v: C = None
        self.s: E = None
        self.u: B = None
        self.w: A = None
        self.p: C = None
        self.x: A = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.t: B = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.s: A = None
        self.w: A = None
        self.p: I = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: E = None
        self.v: C = None
        self.s: E = None
        self.u: B = None
        self.w: A = None
        self.p: C = None
        self.x: A = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: H = None
        self.t: B = None
        self.w: E = None
        self.txt = txt

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

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