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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: D = None
        self.x: H = None
        self.u: I = None
        self.s: D = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.v: C = None
        self.s: H = None
        self.y: F = None
        self.w: B = None
        self.p: E = None
        self.z: E = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.v: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.u: B = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: I = None
        self.y: D = None
        self.x: H = None
        self.u: I = None
        self.s: D = None
        self.o: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.v: C = None
        self.s: H = None
        self.y: F = None
        self.w: B = None
        self.p: E = None
        self.z: E = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: D = None
        self.v: B = None
        self.z: C = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.u: B = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

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