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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: H = None
        self.y: H = None
        self.w: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.w: G = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: H = None
        self.y: H = None
        self.w: G = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.w: G = None
        self.p: C = None
        self.txt = txt

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

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