class A:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.s: C = None
        self.w: H = None
        self.v: D = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.u: I = None
        self.y: G = None
        self.r: I = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: A = None
        self.z: I = None
        self.v: A = None
        self.p: D = None
        self.o: C = None
        self.q: A = None
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: G = None
        self.y: F = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: B = None
        self.s: C = None
        self.w: H = None
        self.v: D = None
        self.z: B = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: A = None
        self.u: I = None
        self.y: G = None
        self.r: I = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: A = None
        self.z: I = None
        self.v: A = None
        self.p: D = None
        self.o: C = None
        self.q: A = None
        self.x: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: G = None
        self.y: F = None
        self.w: C = None
        self.txt = txt

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

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