class A:
    def __init__(self, txt: str):
        self.z: I = None
        self.r: J = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.y: C = None
        self.x: I = None
        self.v: A = None
        self.q: I = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: A = None
        self.x: J = None
        self.z: D = None
        self.v: H = None
        self.u: B = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.v: J = None
        self.x: I = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: J = None
        self.z: G = None
        self.r: B = None
        self.v: D = None
        self.t: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: I = None
        self.u: I = None
        self.s: F = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.y: C = None
        self.x: I = None
        self.v: A = None
        self.q: I = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.r: A = None
        self.x: J = None
        self.z: D = None
        self.v: H = None
        self.u: B = None
        self.y: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: E = None
        self.v: J = None
        self.x: I = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: J = None
        self.z: G = None
        self.r: B = None
        self.v: D = None
        self.t: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: I = None
        self.u: I = None
        self.s: F = None
        self.o: E = None
        self.p: D = None
        self.txt = txt

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

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