class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: D = None
        self.v: H = None
        self.p: I = None
        self.u: E = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: D = None
        self.o: H = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: F = None
        self.v: I = None
        self.p: F = None
        self.t: H = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: H = None
        self.x: I = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.t: F = None
        self.q: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.u: D = None
        self.o: H = None
        self.p: F = None
        self.r: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: F = None
        self.v: I = None
        self.p: F = None
        self.t: H = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: H = None
        self.x: I = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.s: A = None
        self.t: F = None
        self.q: G = None
        self.txt = txt

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

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

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