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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.u: A = None
        self.o: F = None
        self.x: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: E = None
        self.u: A = None
        self.o: F = None
        self.x: F = None
        self.txt = txt

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

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

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

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