class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.v: A = None
        self.u: I = None
        self.o: B = None
        self.z: G = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: H = None
        self.v: A = None
        self.y: A = None
        self.r: C = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: I = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: G = None
        self.v: A = None
        self.u: I = None
        self.o: B = None
        self.z: G = None
        self.s: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.u: H = None
        self.v: A = None
        self.y: A = None
        self.r: C = None
        self.x: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: I = None
        self.txt = txt

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

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

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