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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

d.w = g
e.v = m
e.p = g
e.r = g
e.z = g
e.w = i
e.s = i
e.y = i
e.u = d
f.z = e
f.r = e
f.q = j
f.w = j
f.p = g
f.v = h
f.y = h
g.s = j
g.v = j
a.u = f
a.s = f
j.w = e
j.z = g
j.p = a
j.u = m
h.s = d
h.u = d
h.o = f
h.v = g
h.y = m
h.p = a
h.w = e
m.u = j
m.p = j
m.w = a
m.r = a
m.q = f
m.v = h
m.s = h
m.z = e
i.v = m
i.p = g
i.r = g
i.z = g
i.w = e
i.s = e
i.y = e
i.u = d
assert g.v.p.s.p.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.s: C = None
        self.txt = txt

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

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

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

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

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