class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: F = None
        self.w: D = None
        self.p: G = None
        self.v: F = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: C = None
        self.t: H = None
        self.q: C = None
        self.o: E = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.z: B = None
        self.v: F = None
        self.w: A = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: G = None
        self.q: C = None
        self.s: G = None
        self.o: F = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: F = None
        self.w: D = None
        self.p: G = None
        self.v: F = None
        self.o: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.z: C = None
        self.t: H = None
        self.q: C = None
        self.o: E = None
        self.u: B = None
        self.p: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.y: D = None
        self.z: B = None
        self.v: F = None
        self.w: A = None
        self.q: C = None
        self.t: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: G = None
        self.q: C = None
        self.s: G = None
        self.o: F = None
        self.y: E = None
        self.x: D = None
        self.txt = txt

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

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