class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: H = None
        self.o: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

n = A("n")
e = B("e")
j = C("j")
a = D("a")
g = E("g")
k = F("k")
f = G("f")
h = H("h")
c = I("c")

n.x = h
n.t = f
n.v = a
n.p = e
e.o = h
e.q = k
j.x = n
j.q = a
a.t = e
a.z = e
a.s = g
a.v = c
a.r = k
a.y = f
g.y = k
g.t = h
g.p = a
k.w = n
k.u = a
k.p = g
f.p = j
f.q = h
f.o = g
h.o = n
h.v = a
h.s = k
c.w = h
assert j.q.y.o.p.v.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.v: D = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: H = None
        self.o: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

n = A("n")
e = B("e")
j = C("j")
a = D("a")
g = E("g")
k = F("k")
f = G("f")
h = H("h")
c = I("c")

n.x = h
n.t = f
n.v = a
n.p = e
e.o = h
e.q = k
j.x = n
j.q = a
a.t = e
a.z = e
a.s = g
a.v = c
a.r = k
a.y = f
g.y = k
g.t = h
g.p = a
k.w = n
k.u = a
k.p = g
f.p = j
f.q = h
f.o = g
h.o = n
h.v = a
h.s = k
c.w = h
assert j.q.y.o.p.v.w.o.txt == "n"