class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.o: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.x: I = None
        self.t: F = None
        self.r: I = None
        self.z: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: A = None
        self.v: I = None
        self.w: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.u: A = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: E = None
        self.x: I = None
        self.t: F = None
        self.r: I = None
        self.z: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: A = None
        self.v: I = None
        self.w: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.u: A = None
        self.z: D = None
        self.p: B = None
        self.txt = txt

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

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

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