class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: I = None
        self.q: F = None
        self.v: D = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: D = None
        self.p: B = None
        self.u: B = None
        self.q: H = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: I = None
        self.w: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

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

g.z = h
m.z = k
m.r = a
m.q = h
m.y = h
m.v = d
m.u = b
i.r = n
i.v = n
i.w = d
i.p = m
i.u = m
i.q = k
d.q = i
b.t = m
b.p = m
b.s = d
h.v = f
h.o = f
h.q = d
h.z = a
n.o = h
n.z = k
k.p = n
k.u = a
k.w = m
a.v = g
a.p = g
a.o = h
a.z = h
a.q = m
a.r = m
a.y = b
a.u = b
a.s = n
f.u = h
f.s = h
f.r = a
assert h.v.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: I = None
        self.q: F = None
        self.v: D = None
        self.y: F = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: D = None
        self.p: B = None
        self.u: B = None
        self.q: H = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: D = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.u: I = None
        self.w: B = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: F = None
        self.r: I = None
        self.txt = txt

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

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