class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.u: H = None
        self.z: E = None
        self.o: J = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.v: G = None
        self.w: C = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.r: E = None
        self.y: I = None
        self.w: J = None
        self.o: C = None
        self.v: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: E = None
        self.z: A = None
        self.u: D = None
        self.y: E = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: J = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: A = None
        self.v: G = None
        self.w: C = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.r: E = None
        self.y: I = None
        self.w: J = None
        self.o: C = None
        self.v: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: E = None
        self.z: A = None
        self.u: D = None
        self.y: E = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: J = None
        self.txt = txt

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

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

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