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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: I = None
        self.x: H = None
        self.y: J = None
        self.r: G = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: B = None
        self.r: F = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: I = None
        self.x: H = None
        self.y: J = None
        self.r: G = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: B = None
        self.r: F = None
        self.s: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: I = None
        self.txt = txt

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

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

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

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