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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: G = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: I = None
        self.s: F = None
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: B = None
        self.txt = txt

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

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

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