class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: E = None
        self.r: G = None
        self.z: E = None
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: J = None
        self.u: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: J = None
        self.x: B = None
        self.s: B = None
        self.w: G = None
        self.r: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

m.o = b
m.x = b
m.v = d
m.z = d
m.r = g
n.w = b
n.o = h
k.x = m
k.s = b
k.u = c
f.o = k
f.z = g
f.x = d
f.p = c
d.y = f
d.s = f
d.w = i
d.z = h
d.q = n
d.v = m
d.p = b
i.o = h
i.v = c
i.u = f
g.q = k
g.y = f
g.p = f
g.t = b
g.u = c
g.r = d
h.p = n
h.w = k
h.v = d
c.u = f
c.p = b
c.x = n
c.s = n
c.w = g
c.r = i
b.v = i
b.q = f
assert i.v.p.q.o.s.q.z.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: J = None
        self.v: E = None
        self.r: G = None
        self.z: E = None
        self.x: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: J = None
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: J = None
        self.u: I = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: J = None
        self.x: B = None
        self.s: B = None
        self.w: G = None
        self.r: F = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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