class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: F = None
        self.s: C = None
        self.p: C = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.s: C = None
        self.y: C = None
        self.x: C = None
        self.q: A = None
        self.u: E = None
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.z: H = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: F = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.r: E = None
        self.u: E = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.z: E = None
        self.s: C = None
        self.o: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: E = None
        self.s: C = None
        self.y: C = None
        self.x: C = None
        self.q: A = None
        self.u: E = None
        self.w: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.z: H = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: F = None
        self.u: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.o: G = None
        self.r: E = None
        self.u: E = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.z: E = None
        self.s: C = None
        self.o: G = None
        self.txt = txt

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

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