class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: D = None
        self.u: I = None
        self.y: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: H = None
        self.p: E = None
        self.t: G = None
        self.w: I = None
        self.r: G = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: F = None
        self.x: H = None
        self.u: I = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

n = A("n")
m = B("m")
f = C("f")
l = D("l")
j = E("j")
b = F("b")
k = G("k")
e = H("e")
g = I("g")
a = J("a")

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: H = None
        self.p: E = None
        self.t: G = None
        self.w: I = None
        self.r: G = None
        self.s: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: F = None
        self.q: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: J = None
        self.z: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: F = None
        self.x: H = None
        self.u: I = None
        self.o: H = None
        self.z: B = None
        self.txt = txt

n = A("n")
m = B("m")
f = C("f")
l = D("l")
j = E("j")
b = F("b")
k = G("k")
e = H("e")
g = I("g")
a = J("a")

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