class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: C = None
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: I = None
        self.v: F = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.t: H = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: I = None
        self.v: F = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: D = None
        self.t: H = None
        self.o: B = None
        self.txt = txt

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

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

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

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