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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: G = None
        self.txt = txt

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

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

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

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

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

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