class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.v: H = None
        self.s: G = None
        self.t: E = None
        self.z: I = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: H = None
        self.t: G = None
        self.v: F = None
        self.q: C = None
        self.p: D = None
        self.x: D = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.t: I = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.r: C = None
        self.x: A = None
        self.s: F = None
        self.z: B = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: I = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: D = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: H = None
        self.t: G = None
        self.v: F = None
        self.q: C = None
        self.p: D = None
        self.x: D = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: D = None
        self.t: I = None
        self.z: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.v: B = None
        self.r: C = None
        self.x: A = None
        self.s: F = None
        self.z: B = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: I = None
        self.x: D = None
        self.txt = txt

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

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