class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: H = None
        self.u: H = None
        self.o: J = None
        self.s: D = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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