class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: F = None
        self.t: E = None
        self.v: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: F = None
        self.x: B = None
        self.q: A = None
        self.r: G = None
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: C = None
        self.y: E = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: G = None
        self.o: J = None
        self.y: B = None
        self.s: B = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: H = None
        self.s: G = None
        self.o: I = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: F = None
        self.x: B = None
        self.q: A = None
        self.r: G = None
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: J = None
        self.p: C = None
        self.y: E = None
        self.s: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: G = None
        self.o: J = None
        self.y: B = None
        self.s: B = None
        self.r: C = None
        self.v: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: H = None
        self.s: G = None
        self.o: I = None
        self.x: E = None
        self.txt = txt

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

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