class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: I = None
        self.q: B = None
        self.w: E = None
        self.p: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: G = None
        self.w: H = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.u: A = None
        self.p: H = None
        self.y: I = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: A = None
        self.x: C = None
        self.u: A = None
        self.v: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.r: J = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: I = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: J = None
        self.q: G = None
        self.w: H = None
        self.u: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.z: A = None
        self.u: A = None
        self.p: H = None
        self.y: I = None
        self.x: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: A = None
        self.x: C = None
        self.u: A = None
        self.v: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: F = None
        self.r: J = None
        self.y: F = None
        self.u: A = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: I = None
        self.txt = txt

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

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