class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.z: H = None
        self.s: H = None
        self.x: E = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: I = None
        self.w: H = None
        self.u: C = None
        self.r: H = None
        self.o: C = None
        self.p: B = None
        self.s: B = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.s: F = None
        self.z: D = None
        self.t: E = None
        self.p: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: G = None
        self.t: C = None
        self.p: E = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: D = None
        self.z: H = None
        self.s: H = None
        self.x: E = None
        self.p: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.y: I = None
        self.w: H = None
        self.u: C = None
        self.r: H = None
        self.o: C = None
        self.p: B = None
        self.s: B = None
        self.z: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: D = None
        self.s: F = None
        self.z: D = None
        self.t: E = None
        self.p: C = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: G = None
        self.t: C = None
        self.p: E = None
        self.v: B = None
        self.u: H = None
        self.txt = txt

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

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

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