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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.p: H = None
        self.y: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.u: F = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: J = None
        self.p: F = None
        self.u: I = None
        self.s: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: H = None
        self.q: I = None
        self.u: D = None
        self.txt = txt

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

a.z = b
a.y = b
a.v = f
a.s = f
a.q = f
a.t = c
a.p = j
a.x = i
n.o = i
n.w = a
n.z = g
n.p = g
n.y = g
n.s = f
n.v = f
j.z = b
j.y = b
j.q = c
j.p = f
c.q = b
c.v = n
c.x = n
c.y = a
c.z = a
c.r = g
d.z = f
d.y = j
d.u = g
d.o = b
d.w = i
g.z = f
m.v = c
m.x = n
f.v = m
f.r = i
f.p = g
f.u = b
f.s = j
b.t = n
i.s = g
i.v = f
i.q = b
i.u = c
assert n.z.z.s.p.r.q.t.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: I = None
        self.v: H = None
        self.s: H = None
        self.t: D = None
        self.p: C = None
        self.x: J = None
        self.q: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.p: H = None
        self.y: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.y: C = None
        self.u: F = None
        self.o: I = None
        self.w: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: J = None
        self.p: F = None
        self.u: I = None
        self.s: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: H = None
        self.q: I = None
        self.u: D = None
        self.txt = txt

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

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