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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: G = None
        self.z: A = None
        self.p: A = None
        self.s: C = None
        self.w: D = None
        self.r: C = None
        self.t: J = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

n = A("n")
c = B("c")
f = C("f")
h = D("h")
a = E("a")
j = F("j")
l = G("l")
e = H("e")
k = I("k")
d = J("d")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: G = None
        self.z: A = None
        self.p: A = None
        self.s: C = None
        self.w: D = None
        self.r: C = None
        self.t: J = None
        self.u: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

n = A("n")
c = B("c")
f = C("f")
h = D("h")
a = E("a")
j = F("j")
l = G("l")
e = H("e")
k = I("k")
d = J("d")

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