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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: H = None
        self.z: A = None
        self.q: D = None
        self.x: H = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.v: H = None
        self.p: H = None
        self.s: H = None
        self.x: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.s: C = None
        self.z: G = None
        self.p: F = None
        self.r: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: H = None
        self.z: A = None
        self.q: D = None
        self.x: H = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: C = None
        self.v: H = None
        self.p: H = None
        self.s: H = None
        self.x: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: G = None
        self.s: C = None
        self.z: G = None
        self.p: F = None
        self.r: E = None
        self.txt = txt

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

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