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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.y: E = None
        self.o: F = None
        self.p: D = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.r: C = None
        self.w: C = None
        self.x: H = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: D = None
        self.o: E = None
        self.s: C = None
        self.q: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

i = A("i")
k = B("k")
l = C("l")
f = D("f")
m = E("m")
j = F("j")
g = G("g")
n = H("n")
b = A("b")
h = C("h")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.y: E = None
        self.o: F = None
        self.p: D = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: A = None
        self.r: C = None
        self.w: C = None
        self.x: H = None
        self.v: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.y: D = None
        self.o: E = None
        self.s: C = None
        self.q: B = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.w: F = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

i = A("i")
k = B("k")
l = C("l")
f = D("f")
m = E("m")
j = F("j")
g = G("g")
n = H("n")
b = A("b")
h = C("h")

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