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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: I = None
        self.x: A = None
        self.r: C = None
        self.s: C = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: E = None
        self.t: C = None
        self.y: C = None
        self.r: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: B = None
        self.z: H = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: I = None
        self.q: J = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: J = None
        self.o: I = None
        self.x: A = None
        self.r: C = None
        self.s: C = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: E = None
        self.t: C = None
        self.y: C = None
        self.r: B = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: B = None
        self.z: H = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: I = None
        self.q: J = None
        self.txt = txt

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

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

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

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