class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.q: B = None
        self.z: H = None
        self.u: E = None
        self.p: A = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.u: H = None
        self.s: B = None
        self.w: D = None
        self.v: G = None
        self.o: B = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: D = None
        self.q: E = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: H = None
        self.z: D = None
        self.y: I = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: F = None
        self.q: E = None
        self.s: D = None
        self.z: C = None
        self.r: C = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: G = None
        self.w: D = None
        self.x: H = None
        self.q: G = None
        self.y: C = None
        self.txt = txt

e = A("e")
g = B("g")
i = C("i")
b = D("b")
d = E("d")
l = F("l")
f = G("f")
m = H("m")
n = I("n")
a = D("a")

e.w = n
e.u = g
g.s = d
i.w = n
i.q = f
b.y = m
b.z = m
b.x = f
b.q = g
b.u = d
b.s = d
b.o = d
b.p = e
d.x = g
d.s = g
d.o = g
d.r = f
d.v = f
d.u = m
d.w = b
d.p = n
l.u = n
l.z = a
l.q = d
l.w = f
f.o = i
f.r = m
f.z = a
f.y = n
f.x = d
m.o = n
m.w = l
m.q = d
m.s = a
m.z = i
m.r = i
m.y = b
m.x = f
n.s = d
n.r = f
n.q = f
n.w = a
n.x = m
n.y = i
a.y = m
a.z = m
a.x = f
a.q = g
a.u = d
a.s = d
a.o = d
a.p = e
assert g.s.r.y.y.w.y.q.y.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: I = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.x: G = None
        self.q: B = None
        self.z: H = None
        self.u: E = None
        self.p: A = None
        self.s: E = None
        self.o: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.u: H = None
        self.s: B = None
        self.w: D = None
        self.v: G = None
        self.o: B = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.z: D = None
        self.q: E = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: H = None
        self.z: D = None
        self.y: I = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: F = None
        self.q: E = None
        self.s: D = None
        self.z: C = None
        self.r: C = None
        self.y: D = None
        self.x: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: G = None
        self.w: D = None
        self.x: H = None
        self.q: G = None
        self.y: C = None
        self.txt = txt

e = A("e")
g = B("g")
i = C("i")
b = D("b")
d = E("d")
l = F("l")
f = G("f")
m = H("m")
n = I("n")
a = D("a")

e.w = n
e.u = g
g.s = d
i.w = n
i.q = f
b.y = m
b.z = m
b.x = f
b.q = g
b.u = d
b.s = d
b.o = d
b.p = e
d.x = g
d.s = g
d.o = g
d.r = f
d.v = f
d.u = m
d.w = b
d.p = n
l.u = n
l.z = a
l.q = d
l.w = f
f.o = i
f.r = m
f.z = a
f.y = n
f.x = d
m.o = n
m.w = l
m.q = d
m.s = a
m.z = i
m.r = i
m.y = b
m.x = f
n.s = d
n.r = f
n.q = f
n.w = a
n.x = m
n.y = i
a.y = m
a.z = m
a.x = f
a.q = g
a.u = d
a.s = d
a.o = d
a.p = e
assert g.s.r.y.y.w.y.q.y.s.s.txt == "g"