class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.q: D = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
b = C("b")
c = D("c")
h = E("h")
l = F("l")
k = G("k")
a = E("a")
e = C("e")

n.s = l
n.v = c
m.p = n
m.o = n
b.w = c
b.r = h
b.t = m
c.o = k
c.z = m
c.r = n
c.s = h
h.r = n
h.u = n
h.q = c
l.w = m
l.q = m
k.r = b
a.r = n
a.u = n
a.q = c
e.w = c
e.r = h
e.t = m
assert l.w.p.v.z.o.s.q.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: A = None
        self.q: D = None
        self.txt = txt

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

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

n = A("n")
m = B("m")
b = C("b")
c = D("c")
h = E("h")
l = F("l")
k = G("k")
a = E("a")
e = C("e")

n.s = l
n.v = c
m.p = n
m.o = n
b.w = c
b.r = h
b.t = m
c.o = k
c.z = m
c.r = n
c.s = h
h.r = n
h.u = n
h.q = c
l.w = m
l.q = m
k.r = b
a.r = n
a.u = n
a.q = c
e.w = c
e.r = h
e.t = m
assert l.w.p.v.z.o.s.q.p.s.txt == "l"