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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: H = None
        self.v: B = None
        self.u: G = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: A = None
        self.w: E = None
        self.o: D = None
        self.x: C = None
        self.s: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: H = None
        self.v: B = None
        self.u: G = None
        self.o: E = None
        self.w: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: A = None
        self.w: E = None
        self.o: D = None
        self.x: C = None
        self.s: D = None
        self.txt = txt

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

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