class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.q: B = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: E = None
        self.q: B = None
        self.y: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.o: G = None
        self.u: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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