class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: G = None
        self.x: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: I = None
        self.u: E = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: I = None
        self.u: E = None
        self.s: C = None
        self.v: C = None
        self.txt = txt

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

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

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