class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.x: D = None
        self.w: I = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.p: F = None
        self.v: B = None
        self.y: F = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.p: F = None
        self.v: B = None
        self.y: F = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

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

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

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

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