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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: I = None
        self.y: H = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: I = None
        self.y: H = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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