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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.t: G = None
        self.u: D = None
        self.o: A = None
        self.v: D = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.w: E = None
        self.z: F = None
        self.v: C = None
        self.p: F = None
        self.txt = txt

f = A("f")
g = B("g")
d = C("d")
e = D("e")
j = E("j")
c = F("c")
n = G("n")
b = H("b")
h = C("h")

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

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

class C:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.t: G = None
        self.u: D = None
        self.o: A = None
        self.v: D = None
        self.q: F = None
        self.w: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: B = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: C = None
        self.w: E = None
        self.z: F = None
        self.v: C = None
        self.p: F = None
        self.txt = txt

f = A("f")
g = B("g")
d = C("d")
e = D("e")
j = E("j")
c = F("c")
n = G("n")
b = H("b")
h = C("h")

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