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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.p: D = None
        self.z: J = None
        self.s: I = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.t: B = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: J = None
        self.u: I = None
        self.t: I = None
        self.x: A = None
        self.y: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.x: E = None
        self.o: A = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: I = None
        self.t: J = None
        self.v: A = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: G = None
        self.q: C = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.p: D = None
        self.z: J = None
        self.s: I = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.t: B = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: J = None
        self.u: I = None
        self.t: I = None
        self.x: A = None
        self.y: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.x: E = None
        self.o: A = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: I = None
        self.t: J = None
        self.v: A = None
        self.u: F = None
        self.s: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.o: G = None
        self.q: C = None
        self.v: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

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