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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: C = None
        self.u: C = None
        self.q: F = None
        self.v: F = None
        self.r: G = None
        self.w: C = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: J = None
        self.v: G = None
        self.u: H = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: H = None
        self.s: F = None
        self.t: F = None
        self.x: C = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: J = None
        self.r: H = None
        self.q: H = None
        self.w: J = None
        self.t: J = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.x: B = None
        self.w: E = None
        self.o: B = None
        self.r: E = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: E = None
        self.u: B = None
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: C = None
        self.u: C = None
        self.q: F = None
        self.v: F = None
        self.r: G = None
        self.w: C = None
        self.p: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: J = None
        self.v: G = None
        self.u: H = None
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.p: H = None
        self.s: F = None
        self.t: F = None
        self.x: C = None
        self.r: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: J = None
        self.r: H = None
        self.q: H = None
        self.w: J = None
        self.t: J = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: E = None
        self.x: B = None
        self.w: E = None
        self.o: B = None
        self.r: E = None
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: E = None
        self.u: B = None
        self.t: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.s: H = None
        self.txt = txt

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

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