class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: I = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: I = None
        self.u: B = None
        self.q: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.z: I = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.x: I = None
        self.u: B = None
        self.q: G = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

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

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