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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: A = None
        self.z: D = None
        self.s: I = None
        self.p: D = None
        self.t: H = None
        self.w: A = None
        self.y: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: J = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: A = None
        self.q: B = None
        self.r: D = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.o: A = None
        self.z: E = None
        self.r: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: A = None
        self.z: D = None
        self.s: I = None
        self.p: D = None
        self.t: H = None
        self.w: A = None
        self.y: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: J = None
        self.t: B = None
        self.o: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: A = None
        self.q: B = None
        self.r: D = None
        self.u: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.o: A = None
        self.z: E = None
        self.r: F = None
        self.txt = txt

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

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

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