class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.t: B = None
        self.o: G = None
        self.r: F = None
        self.w: G = None
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.x: C = None
        self.u: I = None
        self.o: A = None
        self.q: C = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.z: D = None
        self.x: I = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: B = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: D = None
        self.x: C = None
        self.u: I = None
        self.o: A = None
        self.q: C = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: H = None
        self.z: D = None
        self.x: I = None
        self.w: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: B = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

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

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

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