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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.x: F = None
        self.p: J = None
        self.s: C = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.s: B = None
        self.w: A = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: J = None
        self.o: H = None
        self.x: B = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.y: F = None
        self.x: F = None
        self.p: J = None
        self.s: C = None
        self.o: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.r: B = None
        self.q: B = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: E = None
        self.s: B = None
        self.w: A = None
        self.p: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: J = None
        self.o: H = None
        self.x: B = None
        self.s: D = None
        self.w: B = None
        self.txt = txt

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

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

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