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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: F = None
        self.s: H = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: G = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: H = None
        self.o: I = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: I = None
        self.p: F = None
        self.s: H = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.u: G = None
        self.o: D = None
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: H = None
        self.o: I = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.u: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: I = None
        self.u: E = None
        self.txt = txt

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

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

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

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