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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: E = None
        self.p: G = None
        self.z: A = None
        self.s: G = None
        self.u: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.u: B = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: I = None
        self.q: J = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: B = None
        self.v: A = None
        self.r: I = None
        self.q: E = None
        self.z: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.v: I = None
        self.t: D = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.r: E = None
        self.p: G = None
        self.z: A = None
        self.s: G = None
        self.u: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: B = None
        self.u: B = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.z: I = None
        self.q: J = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: B = None
        self.v: A = None
        self.r: I = None
        self.q: E = None
        self.z: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.v: I = None
        self.t: D = None
        self.o: E = None
        self.z: A = None
        self.txt = txt

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

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