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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.r: D = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: A = None
        self.y: G = None
        self.q: E = None
        self.z: G = None
        self.t: G = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: E = None
        self.r: D = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: A = None
        self.y: G = None
        self.q: E = None
        self.z: G = None
        self.t: G = None
        self.p: C = None
        self.x: G = None
        self.txt = txt

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

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