class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.t: C = None
        self.s: D = None
        self.z: C = None
        self.w: F = None
        self.o: F = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: H = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.y: A = None
        self.z: F = None
        self.txt = txt

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

n = A("n")
i = B("i")
d = C("d")
g = D("g")
h = E("h")
j = F("j")
k = G("k")
b = H("b")
a = H("a")
f = C("f")

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

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.r: H = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: F = None
        self.y: A = None
        self.z: F = None
        self.txt = txt

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

n = A("n")
i = B("i")
d = C("d")
g = D("g")
h = E("h")
j = F("j")
k = G("k")
b = H("b")
a = H("a")
f = C("f")

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