class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.p: G = None
        self.s: G = None
        self.o: G = None
        self.t: G = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.o: C = None
        self.v: C = None
        self.x: E = None
        self.r: J = None
        self.t: J = 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.p: A = None
        self.v: B = None
        self.t: H = None
        self.r: A = None
        self.x: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: A = None
        self.o: I = None
        self.p: G = None
        self.x: F = None
        self.t: E = None
        self.v: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: E = None
        self.o: C = None
        self.v: C = None
        self.x: E = None
        self.r: J = None
        self.t: J = 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.p: A = None
        self.v: B = None
        self.t: H = None
        self.r: A = None
        self.x: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: A = None
        self.o: I = None
        self.p: G = None
        self.x: F = None
        self.t: E = None
        self.v: A = None
        self.txt = txt

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

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