class A:
    def __init__(self, txt: str):
        self.z: J = None
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: E = None
        self.u: J = None
        self.r: I = None
        self.p: I = None
        self.t: C = None
        self.o: J = None
        self.x: C = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: B = None
        self.r: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: D = None
        self.y: C = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.w: E = None
        self.u: J = None
        self.r: I = None
        self.p: I = None
        self.t: C = None
        self.o: J = None
        self.x: C = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: C = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

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