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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: H = None
        self.o: E = None
        self.u: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: I = None
        self.r: C = None
        self.o: G = None
        self.v: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: E = None
        self.u: I = None
        self.v: A = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: B = None
        self.s: G = None
        self.r: H = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: H = None
        self.o: E = None
        self.u: J = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: J = None
        self.p: I = None
        self.r: C = None
        self.o: G = None
        self.v: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: E = None
        self.u: I = None
        self.v: A = None
        self.w: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: I = None
        self.w: B = None
        self.s: G = None
        self.r: H = None
        self.z: E = None
        self.x: F = None
        self.txt = txt

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

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