class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: C = None
        self.r: I = None
        self.q: G = None
        self.x: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.v: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.q: E = None
        self.z: H = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: D = None
        self.v: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.q: E = None
        self.z: H = None
        self.txt = txt

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

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