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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.s: C = None
        self.y: I = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: A = None
        self.r: F = None
        self.s: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.z: E = None
        self.s: C = None
        self.y: I = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: A = None
        self.r: F = None
        self.s: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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