class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: F = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: F = None
        self.v: E = None
        self.o: H = None
        self.r: G = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: I = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.s: A = None
        self.q: A = None
        self.t: I = None
        self.w: E = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: C = None
        self.q: C = None
        self.w: C = None
        self.p: D = None
        self.t: J = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: F = None
        self.v: E = None
        self.o: H = None
        self.r: G = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: I = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: B = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.s: A = None
        self.q: A = None
        self.t: I = None
        self.w: E = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: C = None
        self.q: C = None
        self.w: C = None
        self.p: D = None
        self.t: J = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: B = None
        self.txt = txt

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

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

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