class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: D = None
        self.v: B = None
        self.u: I = None
        self.r: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.q: B = None
        self.u: H = None
        self.o: E = None
        self.y: E = None
        self.s: F = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: A = None
        self.v: I = None
        self.s: C = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: C = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: D = None
        self.v: B = None
        self.u: I = None
        self.r: I = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.q: B = None
        self.u: H = None
        self.o: E = None
        self.y: E = None
        self.s: F = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: A = None
        self.v: I = None
        self.s: C = None
        self.p: D = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: C = None
        self.s: A = None
        self.v: A = None
        self.txt = txt

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

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