class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: G = None
        self.s: I = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: I = None
        self.s: D = None
        self.q: G = None
        self.z: B = None
        self.y: D = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: C = None
        self.r: D = None
        self.u: C = None
        self.w: B = None
        self.t: B = None
        self.p: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: G = None
        self.s: I = None
        self.z: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: I = None
        self.s: D = None
        self.q: G = None
        self.z: B = None
        self.y: D = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: D = None
        self.r: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: C = None
        self.r: D = None
        self.u: C = None
        self.w: B = None
        self.t: B = None
        self.p: D = None
        self.txt = txt

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

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