class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: J = None
        self.o: J = None
        self.q: A = None
        self.r: A = None
        self.s: J = None
        self.z: B = None
        self.x: H = None
        self.p: H = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: H = None
        self.o: A = None
        self.y: J = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.t: J = None
        self.o: J = None
        self.q: A = None
        self.r: A = None
        self.s: J = None
        self.z: B = None
        self.x: H = None
        self.p: H = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: E = None
        self.z: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: H = None
        self.o: A = None
        self.y: J = None
        self.s: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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