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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: F = None
        self.s: I = None
        self.x: D = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: F = None
        self.s: I = None
        self.x: D = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: A = None
        self.u: D = None
        self.y: D = None
        self.txt = txt

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

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

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