class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.s: H = None
        self.p: B = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: D = None
        self.s: H = None
        self.p: B = None
        self.r: E = None
        self.q: E = None
        self.txt = txt

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

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

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

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