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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: D = None
        self.s: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: D = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: H = None
        self.v: F = None
        self.u: B = None
        self.q: H = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: A = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: D = None
        self.s: G = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: D = None
        self.o: E = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: H = None
        self.v: F = None
        self.u: B = None
        self.q: H = None
        self.z: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: A = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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