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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: A = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: F = None
        self.z: E = None
        self.w: C = None
        self.u: G = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: A = None
        self.z: E = None
        self.p: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.p: D = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: F = None
        self.z: E = None
        self.w: C = None
        self.u: G = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

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