class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.r: H = None
        self.s: J = None
        self.q: G = None
        self.t: I = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: G = None
        self.y: G = None
        self.u: G = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: C = None
        self.s: G = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: D = None
        self.y: B = None
        self.t: I = None
        self.s: J = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: I = None
        self.v: G = None
        self.w: B = None
        self.r: B = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: H = None
        self.t: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.y: F = None
        self.u: D = None
        self.q: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: G = None
        self.y: G = None
        self.u: G = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: J = None
        self.x: C = None
        self.s: G = None
        self.v: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.w: D = None
        self.y: B = None
        self.t: I = None
        self.s: J = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.x: I = None
        self.v: G = None
        self.w: B = None
        self.r: B = None
        self.s: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: H = None
        self.t: F = None
        self.v: C = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.y: F = None
        self.u: D = None
        self.q: H = None
        self.txt = txt

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

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