class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.v: I = None
        self.q: F = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.y: J = None
        self.u: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.r: B = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: I = None
        self.q: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: C = None
        self.y: D = None
        self.v: I = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.w: C = None
        self.y: J = None
        self.u: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.r: B = None
        self.v: D = None
        self.t: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: I = None
        self.q: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: C = None
        self.y: D = None
        self.v: I = None
        self.s: H = None
        self.txt = txt

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

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