class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: C = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: C = None
        self.r: A = None
        self.s: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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