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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.p: I = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: D = None
        self.u: F = None
        self.r: B = None
        self.x: H = None
        self.t: G = None
        self.w: H = None
        self.q: D = None
        self.p: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: H = None
        self.z: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

g.u = l
g.w = n
g.p = b
g.t = i
g.y = f
g.v = k
f.p = m
f.t = g
b.x = n
b.y = f
b.v = g
b.u = k
b.o = h
e.o = h
e.u = n
e.p = l
e.w = i
k.z = b
k.o = e
k.q = e
k.u = n
k.r = f
k.x = i
k.w = i
k.t = h
k.p = m
n.t = k
n.p = h
n.x = i
h.w = m
h.q = i
h.z = e
h.y = n
i.y = k
i.v = n
i.x = l
l.z = e
l.p = f
l.x = n
l.r = h
l.w = b
m.q = g
m.z = f
assert f.t.y.p.q.p.o.w.z.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: I = None
        self.w: F = None
        self.p: C = None
        self.t: H = None
        self.y: B = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: F = None
        self.p: I = None
        self.w: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: D = None
        self.u: F = None
        self.r: B = None
        self.x: H = None
        self.t: G = None
        self.w: H = None
        self.q: D = None
        self.p: J = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: J = None
        self.q: H = None
        self.z: D = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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