class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: B = None
        self.t: E = None
        self.o: J = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: J = None
        self.z: J = None
        self.u: J = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: H = None
        self.s: F = None
        self.v: B = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: H = None
        self.w: B = None
        self.u: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: C = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: J = None
        self.z: J = None
        self.u: J = None
        self.q: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: H = None
        self.s: F = None
        self.v: B = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.s: H = None
        self.z: H = None
        self.w: B = None
        self.u: J = None
        self.txt = txt

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

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

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