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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.u: F = None
        self.y: A = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: B = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.u: F = None
        self.y: A = None
        self.x: F = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: B = None
        self.r: B = None
        self.p: C = None
        self.txt = txt

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

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