class A:
    def __init__(self, txt: str):
        self.o: I = None
        self.q: I = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.y: C = None
        self.z: H = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: B = None
        self.y: G = None
        self.s: I = None
        self.t: E = None
        self.x: F = None
        self.p: A = None
        self.o: A = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: I = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: A = None
        self.y: C = None
        self.z: H = None
        self.u: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: B = None
        self.y: G = None
        self.s: I = None
        self.t: E = None
        self.x: F = None
        self.p: A = None
        self.o: A = None
        self.r: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: I = None
        self.q: G = None
        self.txt = txt

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

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

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

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

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

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

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