class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.q: A = None
        self.r: F = None
        self.p: D = None
        self.v: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.r: C = None
        self.x: A = None
        self.t: E = None
        self.z: A = None
        self.u: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: F = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.x: F = None
        self.q: A = None
        self.txt = txt

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

n.s = g
n.r = g
n.t = c
n.v = c
n.q = e
n.p = i
n.y = l
l.q = k
l.v = k
l.r = d
l.x = n
l.t = c
l.z = e
l.u = e
d.w = i
m.o = g
m.y = k
m.q = i
c.w = n
c.q = e
c.r = l
g.r = k
g.v = h
g.w = l
g.t = e
k.p = m
k.w = c
k.x = h
k.q = e
i.o = h
i.y = k
i.q = m
h.r = k
h.v = g
h.w = l
h.t = n
e.s = h
e.r = h
e.t = c
e.v = c
e.q = n
e.p = i
e.y = l
assert m.o.t.q.r.t.y.x.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.q: A = None
        self.r: F = None
        self.p: D = None
        self.v: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: G = None
        self.r: C = None
        self.x: A = None
        self.t: E = None
        self.z: A = None
        self.u: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: F = None
        self.w: B = None
        self.t: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.x: F = None
        self.q: A = None
        self.txt = txt

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

n.s = g
n.r = g
n.t = c
n.v = c
n.q = e
n.p = i
n.y = l
l.q = k
l.v = k
l.r = d
l.x = n
l.t = c
l.z = e
l.u = e
d.w = i
m.o = g
m.y = k
m.q = i
c.w = n
c.q = e
c.r = l
g.r = k
g.v = h
g.w = l
g.t = e
k.p = m
k.w = c
k.x = h
k.q = e
i.o = h
i.y = k
i.q = m
h.r = k
h.v = g
h.w = l
h.t = n
e.s = h
e.r = h
e.t = c
e.v = c
e.q = n
e.p = i
e.y = l
assert m.o.t.q.r.t.y.x.t.q.txt == "e"