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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.z: D = None
        self.p: D = None
        self.x: A = None
        self.y: H = None
        self.o: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.x: A = None
        self.s: H = None
        self.v: F = None
        self.t: E = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.s: C = None
        self.o: B = None
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.u: G = None
        self.z: D = None
        self.p: D = None
        self.x: A = None
        self.y: H = None
        self.o: A = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.x: A = None
        self.s: H = None
        self.v: F = None
        self.t: E = None
        self.z: H = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.w: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: D = None
        self.s: C = None
        self.o: B = None
        self.w: B = None
        self.txt = txt

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

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