class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: H = None
        self.p: B = None
        self.q: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: F = None
        self.y: I = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: I = None
        self.y: I = None
        self.t: F = None
        self.o: B = None
        self.w: A = None
        self.s: H = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: I = None
        self.r: H = None
        self.u: G = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.w: H = None
        self.s: H = None
        self.y: H = None
        self.p: I = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.z: I = None
        self.q: I = None
        self.o: H = None
        self.x: I = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.t: G = None
        self.p: B = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: H = None
        self.u: F = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: F = None
        self.y: I = None
        self.q: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: I = None
        self.y: I = None
        self.t: F = None
        self.o: B = None
        self.w: A = None
        self.s: H = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: B = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.s: I = None
        self.r: H = None
        self.u: G = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.w: H = None
        self.s: H = None
        self.y: H = None
        self.p: I = None
        self.u: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.z: I = None
        self.q: I = None
        self.o: H = None
        self.x: I = None
        self.w: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.x: A = None
        self.t: G = None
        self.p: B = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: H = None
        self.u: F = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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