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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: D = None
        self.t: H = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.o: C = None
        self.q: H = None
        self.p: G = None
        self.s: A = None
        self.u: B = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: G = None
        self.y: C = None
        self.s: G = None
        self.u: B = None
        self.z: H = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.q: C = None
        self.x: G = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: D = None
        self.t: H = None
        self.r: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: C = None
        self.o: C = None
        self.q: H = None
        self.p: G = None
        self.s: A = None
        self.u: B = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: G = None
        self.y: C = None
        self.s: G = None
        self.u: B = None
        self.z: H = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: C = None
        self.q: C = None
        self.x: G = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

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

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

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