class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: A = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: B = None
        self.r: I = None
        self.v: G = None
        self.x: J = None
        self.y: G = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: G = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: F = None
        self.x: G = None
        self.t: F = None
        self.q: F = None
        self.s: E = None
        self.y: J = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: A = None
        self.q: F = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.s: B = None
        self.r: I = None
        self.v: G = None
        self.x: J = None
        self.y: G = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: D = None
        self.w: G = None
        self.o: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: F = None
        self.x: G = None
        self.t: F = None
        self.q: F = None
        self.s: E = None
        self.y: J = None
        self.txt = txt

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

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

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