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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: H = None
        self.t: H = None
        self.s: B = None
        self.x: C = None
        self.o: I = None
        self.p: A = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: E = None
        self.z: G = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.x: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: H = None
        self.t: H = None
        self.s: B = None
        self.x: C = None
        self.o: I = None
        self.p: A = None
        self.r: C = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: E = None
        self.z: G = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: B = None
        self.x: B = None
        self.v: C = None
        self.txt = txt

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

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

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