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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: E = None
        self.z: B = None
        self.r: I = None
        self.t: F = None
        self.x: I = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: C = None
        self.p: A = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: E = None
        self.t: B = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.v: E = None
        self.z: B = None
        self.r: I = None
        self.t: F = None
        self.x: I = None
        self.o: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: C = None
        self.p: A = None
        self.x: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: E = None
        self.t: B = None
        self.w: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.s: A = None
        self.r: C = None
        self.y: E = None
        self.txt = txt

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

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