class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: F = None
        self.r: I = None
        self.v: G = None
        self.s: F = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: A = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: H = None
        self.s: E = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.t: D = None
        self.r: C = None
        self.u: I = None
        self.w: D = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: F = None
        self.r: I = None
        self.v: G = None
        self.s: F = None
        self.t: E = None
        self.x: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: A = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: H = None
        self.s: E = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: A = None
        self.t: D = None
        self.r: C = None
        self.u: I = None
        self.w: D = None
        self.y: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: D = None
        self.txt = txt

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

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