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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: C = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.x: E = None
        self.r: B = None
        self.z: D = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.w: F = None
        self.r: A = None
        self.o: G = None
        self.txt = txt

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

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

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

i = A("i")
k = B("k")
d = C("d")
a = D("a")
e = E("e")
l = F("l")
g = G("g")
h = H("h")
n = D("n")
m = H("m")

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: C = None
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: G = None
        self.x: E = None
        self.r: B = None
        self.z: D = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: B = None
        self.w: F = None
        self.r: A = None
        self.o: G = None
        self.txt = txt

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

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

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

i = A("i")
k = B("k")
d = C("d")
a = D("a")
e = E("e")
l = F("l")
g = G("g")
h = H("h")
n = D("n")
m = H("m")

i.v = d
k.y = h
k.p = d
k.s = m
d.s = i
d.o = i
d.v = i
d.r = i
d.x = e
d.y = l
d.p = k
d.w = h
a.o = e
a.x = e
a.p = g
a.r = k
a.z = n
a.u = d
e.z = n
e.s = k
e.w = l
e.r = i
e.o = g
l.s = e
l.y = h
l.x = a
l.o = g
l.p = i
g.u = k
g.x = e
g.t = a
g.v = d
h.w = m
h.x = m
h.v = n
h.t = d
h.y = g
h.r = e
h.z = k
h.p = l
n.o = e
n.x = e
n.p = g
n.r = k
n.z = a
n.u = d
m.w = h
m.x = h
m.v = n
m.t = d
m.y = g
m.r = e
m.z = k
m.p = l
assert m.v.x.z.z.z.u.p.txt == "k"