class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: A = None
        self.z: C = None
        self.s: H = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.r: A = None
        self.z: C = None
        self.s: H = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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