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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.x: B = None
        self.w: B = None
        self.t: D = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.t: B = None
        self.q: D = None
        self.u: B = None
        self.w: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: B = None
        self.x: B = None
        self.w: B = None
        self.t: D = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.t: B = None
        self.q: D = None
        self.u: B = None
        self.w: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.txt = txt

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

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