class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.w: F = None
        self.z: F = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: G = None
        self.r: A = None
        self.q: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: I = None
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: G = None
        self.r: A = None
        self.q: D = None
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: I = None
        self.v: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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