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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.u: E = None
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.u: E = None
        self.s: E = None
        self.v: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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