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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.t: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: I = None
        self.r: C = None
        self.z: I = None
        self.p: G = None
        self.u: H = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.t: F = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: I = None
        self.r: C = None
        self.z: I = None
        self.p: G = None
        self.u: H = None
        self.txt = txt

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

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