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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: I = None
        self.z: G = None
        self.r: B = None
        self.v: H = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: H = None
        self.z: D = None
        self.r: H = None
        self.p: C = None
        self.t: I = None
        self.q: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: I = None
        self.t: D = None
        self.r: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: G = None
        self.v: J = None
        self.x: F = None
        self.p: E = None
        self.w: I = None
        self.y: I = None
        self.t: A = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: A = None
        self.o: G = None
        self.z: B = None
        self.p: E = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: G = None
        self.t: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: I = None
        self.z: G = None
        self.r: B = None
        self.v: H = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: H = None
        self.z: D = None
        self.r: H = None
        self.p: C = None
        self.t: I = None
        self.q: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.q: I = None
        self.t: D = None
        self.r: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: G = None
        self.v: J = None
        self.x: F = None
        self.p: E = None
        self.w: I = None
        self.y: I = None
        self.t: A = None
        self.q: J = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: H = None
        self.s: A = None
        self.o: G = None
        self.z: B = None
        self.p: E = None
        self.v: E = None
        self.u: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: G = None
        self.t: G = None
        self.txt = txt

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

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