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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.s: A = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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