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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.u: G = None
        self.y: A = None
        self.w: F = None
        self.q: I = None
        self.t: D = None
        self.s: J = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.o: B = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: F = None
        self.u: G = None
        self.y: A = None
        self.w: F = None
        self.q: I = None
        self.t: D = None
        self.s: J = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: A = None
        self.o: B = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: I = None
        self.w: A = None
        self.z: F = None
        self.txt = txt

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

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

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

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