class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.w: C = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.p: C = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: A = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.q: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: G = None
        self.p: C = None
        self.t: G = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

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