class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.u: F = None
        self.y: H = None
        self.x: F = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: G = None
        self.s: G = None
        self.r: G = None
        self.v: C = None
        self.o: C = None
        self.w: D = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: B = None
        self.x: D = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: F = None
        self.u: F = None
        self.y: H = None
        self.x: F = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.u: G = None
        self.s: G = None
        self.r: G = None
        self.v: C = None
        self.o: C = None
        self.w: D = None
        self.x: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: B = None
        self.x: D = None
        self.q: F = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.o: G = None
        self.t: C = None
        self.txt = txt

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

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