class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: I = None
        self.p: C = None
        self.z: E = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: G = None
        self.p: C = None
        self.t: D = None
        self.o: E = None
        self.s: J = None
        self.q: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: C = None
        self.x: F = None
        self.y: H = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.y: I = None
        self.p: C = None
        self.z: E = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: G = None
        self.p: C = None
        self.t: D = None
        self.o: E = None
        self.s: J = None
        self.q: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: C = None
        self.x: F = None
        self.y: H = None
        self.w: F = None
        self.txt = txt

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

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