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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: I = None
        self.u: I = None
        self.p: D = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.x: C = None
        self.p: I = None
        self.u: C = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: I = None
        self.u: I = None
        self.p: D = None
        self.s: D = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.x: C = None
        self.p: I = None
        self.u: C = None
        self.s: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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