class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: H = None
        self.p: F = None
        self.q: I = None
        self.u: J = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: E = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: B = None
        self.z: A = None
        self.s: A = None
        self.u: B = None
        self.t: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.o: A = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: G = None
        self.r: A = None
        self.p: G = None
        self.v: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: A = None
        self.txt = txt

h = A("h")
a = B("a")
c = C("c")
d = D("d")
m = E("m")
f = F("f")
e = G("e")
l = H("l")
n = I("n")
g = J("g")

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: H = None
        self.p: F = None
        self.q: I = None
        self.u: J = None
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: E = None
        self.r: I = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: B = None
        self.z: A = None
        self.s: A = None
        self.u: B = None
        self.t: J = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.o: A = None
        self.v: B = None
        self.y: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: G = None
        self.r: A = None
        self.p: G = None
        self.v: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: A = None
        self.txt = txt

h = A("h")
a = B("a")
c = C("c")
d = D("d")
m = E("m")
f = F("f")
e = G("e")
l = H("l")
n = I("n")
g = J("g")

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