class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: J = None
        self.w: E = None
        self.p: H = None
        self.t: C = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: I = None
        self.w: J = None
        self.z: F = None
        self.v: J = None
        self.y: D = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.s: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: I = None
        self.v: E = None
        self.r: H = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.s: I = None
        self.w: J = None
        self.z: F = None
        self.v: J = None
        self.y: D = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: F = None
        self.s: A = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.q: I = None
        self.v: E = None
        self.r: H = None
        self.o: B = None
        self.y: C = None
        self.txt = txt

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

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