class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.r: E = None
        self.s: C = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.x: C = None
        self.u: F = None
        self.y: E = None
        self.r: D = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
e = B("e")
l = C("l")
c = D("c")
i = E("i")
g = F("g")
b = G("b")
a = H("a")
n = A("n")

h.p = i
h.r = i
h.y = l
h.s = l
h.w = b
h.z = g
e.p = l
e.x = l
e.v = c
e.r = c
e.u = g
e.y = i
e.s = a
l.s = i
c.z = b
c.v = h
i.s = a
i.x = a
i.w = c
i.z = c
i.u = n
i.p = l
i.v = e
i.r = b
g.r = a
g.s = a
g.y = b
g.u = b
g.p = h
g.w = e
g.x = i
b.x = i
b.z = e
b.t = l
a.z = c
a.x = i
a.p = i
a.t = e
a.q = h
n.p = i
n.r = i
n.y = l
n.s = l
n.w = b
n.z = g
assert n.r.u.z.w.y.p.s.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: C = None
        self.r: E = None
        self.s: C = None
        self.w: G = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.v: D = None
        self.x: C = None
        self.u: F = None
        self.y: E = None
        self.r: D = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

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

h = A("h")
e = B("e")
l = C("l")
c = D("c")
i = E("i")
g = F("g")
b = G("b")
a = H("a")
n = A("n")

h.p = i
h.r = i
h.y = l
h.s = l
h.w = b
h.z = g
e.p = l
e.x = l
e.v = c
e.r = c
e.u = g
e.y = i
e.s = a
l.s = i
c.z = b
c.v = h
i.s = a
i.x = a
i.w = c
i.z = c
i.u = n
i.p = l
i.v = e
i.r = b
g.r = a
g.s = a
g.y = b
g.u = b
g.p = h
g.w = e
g.x = i
b.x = i
b.z = e
b.t = l
a.z = c
a.x = i
a.p = i
a.t = e
a.q = h
n.p = i
n.r = i
n.y = l
n.s = l
n.w = b
n.z = g
assert n.r.u.z.w.y.p.s.s.z.txt == "c"