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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.w: H = None
        self.y: E = None
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: D = None
        self.s: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.s: H = None
        self.w: H = None
        self.y: E = None
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.o: D = None
        self.s: A = None
        self.r: H = None
        self.txt = txt

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

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

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

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

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