class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: H = None
        self.o: G = None
        self.x: D = None
        self.txt = txt

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

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

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

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

n.t = f
g.y = j
g.x = j
g.q = a
g.t = a
g.p = n
g.w = m
m.o = a
k.y = g
k.w = m
k.z = j
h.s = k
h.x = k
h.z = a
h.o = b
j.s = n
j.u = n
b.z = g
b.q = m
b.v = a
b.y = n
b.u = j
b.s = j
a.q = m
a.w = m
f.z = g
f.q = m
f.v = a
f.y = n
f.u = j
f.s = j
assert f.z.x.s.t.v.q.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: H = None
        self.o: G = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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