class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: G = None
        self.x: F = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: E = None
        self.o: A = None
        self.q: I = None
        self.x: E = None
        self.s: F = None
        self.p: A = None
        self.w: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: F = None
        self.u: G = None
        self.w: I = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

g.q = a
g.p = n
g.x = i
g.w = m
m.p = g
m.w = k
d.u = e
d.v = c
d.x = c
d.o = g
d.p = g
d.q = a
d.w = a
d.s = i
k.p = i
c.p = d
c.s = a
i.p = g
i.x = g
n.q = g
n.p = i
n.x = k
e.q = a
e.w = a
e.t = i
e.u = n
e.o = g
e.p = d
a.z = d
h.u = e
h.v = c
h.x = c
h.o = g
h.p = g
h.q = a
h.w = a
h.s = i
assert i.x.q.z.u.p.u.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: G = None
        self.x: F = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: E = None
        self.o: A = None
        self.q: I = None
        self.x: E = None
        self.s: F = None
        self.p: A = None
        self.w: I = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.t: F = None
        self.u: G = None
        self.w: I = None
        self.o: A = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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