class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.z: F = None
        self.w: E = None
        self.y: H = None
        self.u: E = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.u: C = None
        self.p: E = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: G = None
        self.u: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.x: A = None
        self.q: C = None
        self.o: B = None
        self.txt = txt

d = A("d")
j = B("j")
n = C("n")
f = D("f")
m = E("m")
i = F("i")
e = G("e")
k = H("k")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: E = None
        self.u: C = None
        self.p: E = None
        self.y: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: A = None
        self.v: D = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: G = None
        self.u: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.v: B = None
        self.x: A = None
        self.q: C = None
        self.o: B = None
        self.txt = txt

d = A("d")
j = B("j")
n = C("n")
f = D("f")
m = E("m")
i = F("i")
e = G("e")
k = H("k")

d.s = f
d.r = m
d.w = m
d.u = m
d.z = i
d.y = k
d.x = k
j.r = f
j.y = f
j.w = m
j.p = m
j.u = n
n.o = d
n.p = d
n.v = f
n.t = f
f.q = d
m.y = k
m.w = e
m.q = d
m.z = n
m.p = f
i.s = n
i.o = e
i.u = d
e.s = f
e.t = k
e.u = k
e.x = k
e.r = k
e.p = i
e.q = i
k.z = f
k.v = j
k.o = j
k.x = d
k.q = n
assert n.v.q.x.z.q.z.s.v.txt == "f"