class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: H = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.o: G = None
        self.v: G = None
        self.r: J = None
        self.w: D = None
        self.x: J = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.r: A = None
        self.u: A = None
        self.z: B = None
        self.y: H = None
        self.p: H = None
        self.q: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: B = None
        self.r: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: E = None
        self.w: H = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: H = None
        self.z: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: I = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: G = None
        self.o: G = None
        self.v: G = None
        self.r: J = None
        self.w: D = None
        self.x: J = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: H = None
        self.r: A = None
        self.u: A = None
        self.z: B = None
        self.y: H = None
        self.p: H = None
        self.q: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: B = None
        self.r: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: E = None
        self.w: H = None
        self.z: B = None
        self.txt = txt

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

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