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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: J = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: I = None
        self.t: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: J = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: I = None
        self.t: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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