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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.r: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: B = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.s: C = None
        self.u: I = None
        self.t: B = None
        self.z: H = None
        self.w: A = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: B = None
        self.r: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.v: B = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.s: C = None
        self.u: I = None
        self.t: B = None
        self.z: H = None
        self.w: A = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

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

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