class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: J = None
        self.r: E = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.p: A = None
        self.v: D = None
        self.r: E = None
        self.x: C = None
        self.q: G = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: G = None
        self.o: I = None
        self.w: G = None
        self.s: F = None
        self.u: H = None
        self.q: G = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.x: G = None
        self.r: I = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: C = None
        self.p: B = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: I = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: F = None
        self.p: A = None
        self.v: D = None
        self.r: E = None
        self.x: C = None
        self.q: G = None
        self.z: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: G = None
        self.o: I = None
        self.w: G = None
        self.s: F = None
        self.u: H = None
        self.q: G = None
        self.p: G = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.p: C = None
        self.x: G = None
        self.r: I = None
        self.s: E = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: C = None
        self.p: B = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: I = None
        self.txt = txt

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

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

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

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