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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.r: E = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: B = None
        self.r: D = None
        self.w: H = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.p: F = None
        self.r: E = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: B = None
        self.r: D = None
        self.w: H = None
        self.t: D = None
        self.txt = txt

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

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

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

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