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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: I = None
        self.q: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.v: B = None
        self.t: G = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.q: E = None
        self.p: F = None
        self.u: C = None
        self.z: C = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: I = None
        self.q: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: B = None
        self.v: B = None
        self.t: G = None
        self.s: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: E = None
        self.q: E = None
        self.p: F = None
        self.u: C = None
        self.z: C = None
        self.v: A = None
        self.t: B = None
        self.txt = txt

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

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