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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.y: C = None
        self.q: C = None
        self.w: I = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: C = None
        self.s: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: A = None
        self.y: C = None
        self.q: C = None
        self.w: I = None
        self.txt = txt

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

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

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

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