class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: I = None
        self.o: F = None
        self.v: F = None
        self.r: H = None
        self.w: G = None
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: I = None
        self.o: D = None
        self.r: J = None
        self.p: J = None
        self.q: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

j = A("j")
d = B("d")
e = C("e")
f = D("f")
h = E("h")
i = F("i")
l = G("l")
b = H("b")
g = I("g")
n = J("n")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: I = None
        self.o: D = None
        self.r: J = None
        self.p: J = None
        self.q: D = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

j = A("j")
d = B("d")
e = C("e")
f = D("f")
h = E("h")
i = F("i")
l = G("l")
b = H("b")
g = I("g")
n = J("n")

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