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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: E = None
        self.q: E = None
        self.o: A = None
        self.u: J = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.z: B = None
        self.u: B = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: A = None
        self.p: J = None
        self.u: D = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: J = None
        self.r: E = None
        self.p: E = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: I = None
        self.r: D = None
        self.t: E = None
        self.v: I = None
        self.u: I = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: C = None
        self.r: A = None
        self.q: F = None
        self.v: B = None
        self.o: D = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: A = None
        self.y: C = None
        self.p: I = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: E = None
        self.q: E = None
        self.o: A = None
        self.u: J = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: F = None
        self.z: B = None
        self.u: B = None
        self.q: G = None
        self.v: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: A = None
        self.p: J = None
        self.u: D = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: J = None
        self.t: J = None
        self.r: E = None
        self.p: E = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: I = None
        self.r: D = None
        self.t: E = None
        self.v: I = None
        self.u: I = None
        self.s: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: C = None
        self.r: A = None
        self.q: F = None
        self.v: B = None
        self.o: D = None
        self.z: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: A = None
        self.y: C = None
        self.p: I = None
        self.r: G = None
        self.txt = txt

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

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