class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: H = None
        self.q: G = None
        self.z: H = None
        self.p: D = None
        self.r: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.x: H = None
        self.q: E = None
        self.t: F = None
        self.p: F = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.v: B = None
        self.y: D = None
        self.u: B = None
        self.o: A = None
        self.r: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: C = None
        self.x: H = None
        self.q: E = None
        self.t: F = None
        self.p: F = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.z: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.x: A = None
        self.v: B = None
        self.y: D = None
        self.u: B = None
        self.o: A = None
        self.r: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: C = None
        self.txt = txt

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

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

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