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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: E = None
        self.v: C = None
        self.x: I = None
        self.q: E = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: H = None
        self.o: H = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: I = None
        self.x: J = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: J = None
        self.t: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: H = None
        self.z: D = None
        self.p: C = None
        self.o: B = None
        self.y: H = None
        self.x: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: G = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: E = None
        self.p: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: E = None
        self.v: C = None
        self.x: I = None
        self.q: E = None
        self.r: A = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: H = None
        self.o: H = None
        self.v: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: I = None
        self.x: J = None
        self.w: E = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: J = None
        self.t: F = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: H = None
        self.z: D = None
        self.p: C = None
        self.o: B = None
        self.y: H = None
        self.x: A = None
        self.txt = txt

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

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