class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.w: I = None
        self.x: C = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: A = None
        self.p: I = None
        self.o: B = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: D = None
        self.v: J = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: F = None
        self.u: I = None
        self.s: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: A = None
        self.r: I = None
        self.s: E = None
        self.z: E = None
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: J = None
        self.v: F = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: D = None
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: A = None
        self.p: I = None
        self.o: B = None
        self.y: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: H = None
        self.u: D = None
        self.v: J = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: F = None
        self.u: I = None
        self.s: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: A = None
        self.r: I = None
        self.s: E = None
        self.z: E = None
        self.x: A = None
        self.v: G = None
        self.txt = txt

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

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