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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.o: G = None
        self.v: C = None
        self.r: H = None
        self.x: B = None
        self.t: C = None
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: I = None
        self.x: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: G = None
        self.y: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: E = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.o: G = None
        self.v: C = None
        self.r: H = None
        self.x: B = None
        self.t: C = None
        self.y: H = None
        self.p: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: I = None
        self.x: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: G = None
        self.y: I = None
        self.txt = txt

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

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