class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: H = None
        self.y: G = None
        self.o: I = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: C = None
        self.s: A = None
        self.o: J = None
        self.y: H = None
        self.z: H = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: F = None
        self.q: C = None
        self.w: H = None
        self.y: B = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.u: J = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

e.r = n
e.s = b
e.y = a
e.o = k
e.u = k
f.s = g
f.w = g
f.r = h
f.t = h
f.x = e
f.z = e
f.o = e
f.u = b
f.v = c
f.y = n
h.w = e
h.z = g
h.r = b
h.v = b
h.u = b
h.o = b
h.s = d
h.p = c
h.t = n
d.t = c
d.z = c
d.y = n
d.x = e
g.r = e
c.q = n
c.o = n
c.w = h
c.s = e
c.y = b
c.z = b
c.r = a
a.o = k
a.p = k
a.x = c
a.q = h
a.w = b
a.y = f
b.w = e
b.r = a
b.v = a
b.u = n
b.p = h
k.z = h
k.o = f
n.v = e
assert e.r.v.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: J = None
        self.s: H = None
        self.y: G = None
        self.o: I = None
        self.u: I = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: J = None
        self.w: C = None
        self.s: A = None
        self.o: J = None
        self.y: H = None
        self.z: H = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.x: F = None
        self.q: C = None
        self.w: H = None
        self.y: B = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: G = None
        self.u: J = None
        self.v: G = None
        self.p: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.txt = txt

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

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

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