class A:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: J = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: J = None
        self.w: D = None
        self.t: G = None
        self.x: C = None
        self.r: B = None
        self.y: F = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: B = None
        self.v: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: E = None
        self.w: D = None
        self.p: B = None
        self.t: G = None
        self.q: E = None
        self.r: D = None
        self.x: D = None
        self.u: C = None
        self.y: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: J = None
        self.w: D = None
        self.t: G = None
        self.x: C = None
        self.r: B = None
        self.y: F = None
        self.u: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: B = None
        self.v: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: E = None
        self.w: D = None
        self.p: B = None
        self.t: G = None
        self.q: E = None
        self.r: D = None
        self.x: D = None
        self.u: C = None
        self.y: I = None
        self.txt = txt

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

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

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

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