class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.t: C = None
        self.w: H = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: A = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: H = None
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: A = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: H = None
        self.u: A = None
        self.w: F = None
        self.txt = txt

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

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

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

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