class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: H = None
        self.y: F = None
        self.o: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: I = None
        self.r: J = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: A = None
        self.s: A = None
        self.z: J = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.o: J = None
        self.q: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: I = None
        self.r: J = None
        self.y: C = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: A = None
        self.s: A = None
        self.z: J = None
        self.x: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.o: J = None
        self.q: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: B = None
        self.txt = txt

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

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