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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

e.s = d
e.y = a
i.r = c
g.s = c
g.z = e
g.p = i
g.x = i
g.t = i
n.y = g
n.x = c
n.v = a
n.p = a
d.y = i
k.w = n
k.s = n
c.w = n
c.s = n
a.s = d
a.y = e
assert n.y.x.r.w.y.z.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

e.s = d
e.y = a
i.r = c
g.s = c
g.z = e
g.p = i
g.x = i
g.t = i
n.y = g
n.x = c
n.v = a
n.p = a
d.y = i
k.w = n
k.s = n
c.w = n
c.s = n
a.s = d
a.y = e
assert n.y.x.r.w.y.z.s.y.txt == "i"