class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.r: I = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: G = None
        self.o: D = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: D = None
        self.o: I = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.v: A = None
        self.o: I = None
        self.z: D = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: E = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: G = None
        self.o: D = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.u: D = None
        self.o: I = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: A = None
        self.v: A = None
        self.o: I = None
        self.z: D = None
        self.p: G = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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