class A:
    def __init__(self, txt: str):
        self.z: D = 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.w: A = None
        self.x: H = None
        self.p: H = None
        self.q: D = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.v: B = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

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

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

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

h.z = n
l.p = h
a.w = h
a.x = f
a.p = f
a.q = n
a.u = l
n.t = i
n.u = d
n.p = a
n.q = a
n.v = j
n.x = e
j.t = l
j.u = h
j.z = a
j.r = f
d.p = j
d.t = l
d.v = l
d.r = n
d.w = h
i.t = h
i.p = l
i.q = d
f.z = j
f.s = j
f.y = d
f.o = n
f.p = n
f.q = n
f.x = e
e.t = h
e.p = l
e.q = d
assert i.t.z.t.q.w.z.p.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = 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.w: A = None
        self.x: H = None
        self.p: H = None
        self.q: D = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.u: A = None
        self.z: C = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: B = None
        self.v: B = None
        self.r: D = None
        self.w: A = None
        self.txt = txt

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

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

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

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