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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: I = None
        self.z: E = None
        self.o: I = None
        self.u: E = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: H = None
        self.q: A = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.t: I = None
        self.q: I = None
        self.u: J = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: A = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: C = None
        self.q: F = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

d = A("d")
f = B("f")
n = C("n")
b = D("b")
i = E("i")
j = F("j")
m = G("m")
a = H("a")
g = I("g")
c = J("c")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: I = None
        self.z: E = None
        self.o: I = None
        self.u: E = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: H = None
        self.q: A = None
        self.y: J = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: A = None
        self.t: I = None
        self.q: I = None
        self.u: J = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.u: A = None
        self.y: G = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: C = None
        self.q: F = None
        self.x: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

d = A("d")
f = B("f")
n = C("n")
b = D("b")
i = E("i")
j = F("j")
m = G("m")
a = H("a")
g = I("g")
c = J("c")

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