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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: B = None
        self.p: E = None
        self.z: B = None
        self.x: G = None
        self.t: E = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.u: B = None
        self.p: G = None
        self.y: H = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: H = None
        self.y: B = None
        self.z: H = None
        self.w: E = None
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: B = None
        self.p: E = None
        self.z: B = None
        self.x: G = None
        self.t: E = None
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: B = None
        self.u: B = None
        self.p: G = None
        self.y: H = None
        self.x: C = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: H = None
        self.y: B = None
        self.z: H = None
        self.w: E = None
        self.x: B = None
        self.txt = txt

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

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