class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: D = None
        self.p: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.s: I = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.y: B = None
        self.o: H = None
        self.s: B = None
        self.x: E = None
        self.p: H = None
        self.u: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.v: I = None
        self.p: E = None
        self.o: A = None
        self.s: A = None
        self.y: J = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.s: I = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: A = None
        self.y: B = None
        self.o: H = None
        self.s: B = None
        self.x: E = None
        self.p: H = None
        self.u: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: F = None
        self.v: I = None
        self.p: E = None
        self.o: A = None
        self.s: A = None
        self.y: J = None
        self.txt = txt

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

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

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

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