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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

e.s = m
e.r = a
l.p = m
l.z = a
h.s = d
h.v = l
h.o = l
h.x = k
b.w = m
b.r = m
b.v = e
m.x = h
n.p = d
n.t = d
n.v = h
d.x = b
k.s = d
k.v = l
k.o = l
k.x = h
a.s = m
a.r = e
f.p = d
f.t = d
f.v = h
assert k.s.x.v.r.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.v: B = None
        self.x: C = None
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: G = None
        self.v: C = None
        self.txt = txt

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

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

e.s = m
e.r = a
l.p = m
l.z = a
h.s = d
h.v = l
h.o = l
h.x = k
b.w = m
b.r = m
b.v = e
m.x = h
n.p = d
n.t = d
n.v = h
d.x = b
k.s = d
k.v = l
k.o = l
k.x = h
a.s = m
a.r = e
f.p = d
f.t = d
f.v = h
assert k.s.x.v.r.s.txt == "m"