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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: C = None
        self.r: G = None
        self.y: B = None
        self.q: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: C = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.s: B = None
        self.t: B = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.w: C = None
        self.r: G = None
        self.y: B = None
        self.q: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: J = None
        self.z: C = None
        self.r: C = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: D = None
        self.s: B = None
        self.t: B = None
        self.y: A = None
        self.x: A = None
        self.txt = txt

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

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