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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.s: A = None
        self.y: D = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.u: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: B = None
        self.s: A = None
        self.y: D = None
        self.z: F = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: D = None
        self.u: E = None
        self.r: C = None
        self.txt = txt

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

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