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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.s: D = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: H = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.z: E = None
        self.y: E = None
        self.t: E = None
        self.q: G = None
        self.w: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.z: F = None
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: B = None
        self.s: D = None
        self.z: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: H = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: H = None
        self.p: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.z: E = None
        self.y: E = None
        self.t: E = None
        self.q: G = None
        self.w: E = None
        self.txt = txt

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

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