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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: D = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.x: G = None
        self.y: D = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: F = None
        self.p: D = None
        self.r: C = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: I = None
        self.u: D = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.z: D = None
        self.x: G = None
        self.y: D = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: F = None
        self.p: D = None
        self.r: C = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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