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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.z: D = None
        self.s: B = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: B = None
        self.o: E = None
        self.q: D = None
        self.v: H = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: G = None
        self.z: D = None
        self.s: B = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: B = None
        self.o: E = None
        self.q: D = None
        self.v: H = None
        self.z: A = None
        self.txt = txt

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

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

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