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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: H = None
        self.q: B = None
        self.v: G = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: H = None
        self.u: H = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.y: A = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: H = None
        self.q: B = None
        self.v: G = None
        self.u: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.q: H = None
        self.u: H = None
        self.v: F = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: B = None
        self.y: A = None
        self.v: B = None
        self.r: C = None
        self.txt = txt

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

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