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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: I = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: I = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: F = None
        self.u: E = None
        self.txt = txt

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

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

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