class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.z: B = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.w: J = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: J = None
        self.t: J = None
        self.s: F = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.v: E = None
        self.t: A = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

i = A("i")
m = B("m")
n = C("n")
b = D("b")
l = E("l")
f = F("f")
g = G("g")
e = H("e")
h = I("h")
k = J("k")

i.t = g
i.s = b
i.z = m
i.w = f
m.r = i
m.u = f
m.p = f
m.w = k
m.v = l
n.y = b
n.q = k
n.t = k
n.s = f
n.w = m
n.z = i
b.t = k
l.r = k
f.q = i
f.u = m
g.r = m
e.v = l
e.x = n
e.t = b
h.s = g
h.u = i
k.w = f
k.y = f
k.v = l
k.s = l
k.t = i
k.o = e
assert h.u.s.t.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.z: B = None
        self.w: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: F = None
        self.w: J = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: J = None
        self.t: J = None
        self.s: F = None
        self.w: B = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

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

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

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

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

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

class J:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: F = None
        self.v: E = None
        self.t: A = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

i = A("i")
m = B("m")
n = C("n")
b = D("b")
l = E("l")
f = F("f")
g = G("g")
e = H("e")
h = I("h")
k = J("k")

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