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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: B = None
        self.s: F = None
        self.p: I = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: J = None
        self.w: I = None
        self.y: A = None
        self.z: G = None
        self.p: F = None
        self.v: F = None
        self.q: J = None
        self.o: I = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.p: F = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.y: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: B = None
        self.s: F = None
        self.p: I = None
        self.z: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: J = None
        self.r: J = None
        self.w: I = None
        self.y: A = None
        self.z: G = None
        self.p: F = None
        self.v: F = None
        self.q: J = None
        self.o: I = None
        self.u: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.o: J = None
        self.p: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.w: D = None
        self.p: F = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: J = None
        self.r: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: H = None
        self.y: G = None
        self.txt = txt

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

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