class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.y: H = None
        self.o: B = None
        self.x: D = None
        self.q: F = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: I = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.v: G = None
        self.y: F = None
        self.q: F = None
        self.z: G = None
        self.o: G = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: D = None
        self.t: I = None
        self.q: H = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: B = None
        self.p: A = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: E = None
        self.z: G = None
        self.x: I = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: C = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: I = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: C = None
        self.v: G = None
        self.y: F = None
        self.q: F = None
        self.z: G = None
        self.o: G = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.v: D = None
        self.t: I = None
        self.q: H = None
        self.w: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: B = None
        self.p: A = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: E = None
        self.z: G = None
        self.x: I = None
        self.w: F = None
        self.txt = txt

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

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