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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: J = None
        self.v: C = None
        self.r: I = None
        self.w: C = None
        self.p: I = None
        self.q: F = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: E = None
        self.v: F = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: J = None
        self.v: C = None
        self.r: I = None
        self.w: C = None
        self.p: I = None
        self.q: F = None
        self.z: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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