class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: B = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: B = None
        self.t: E = None
        self.w: F = None
        self.p: J = None
        self.v: I = None
        self.r: F = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: F = None
        self.z: B = None
        self.p: B = None
        self.w: H = None
        self.s: A = None
        self.r: C = None
        self.t: J = None
        self.o: I = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: J = None
        self.q: B = None
        self.w: H = None
        self.p: J = None
        self.s: D = None
        self.z: J = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: J = None
        self.v: A = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: B = None
        self.x: G = None
        self.o: D = None
        self.u: C = None
        self.z: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: B = None
        self.t: E = None
        self.w: F = None
        self.p: J = None
        self.v: I = None
        self.r: F = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: F = None
        self.z: B = None
        self.p: B = None
        self.w: H = None
        self.s: A = None
        self.r: C = None
        self.t: J = None
        self.o: I = None
        self.x: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.o: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.r: J = None
        self.q: B = None
        self.w: H = None
        self.p: J = None
        self.s: D = None
        self.z: J = None
        self.x: E = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: J = None
        self.v: A = None
        self.u: A = None
        self.p: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: C = None
        self.x: E = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: I = None
        self.s: B = None
        self.x: G = None
        self.o: D = None
        self.u: C = None
        self.z: E = None
        self.txt = txt

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

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