class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: G = None
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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