class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.q: G = None
        self.s: B = None
        self.u: B = None
        self.v: A = None
        self.y: G = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: A = None
        self.u: A = None
        self.t: D = None
        self.q: A = None
        self.x: A = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: D = None
        self.w: D = None
        self.q: B = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.v: F = None
        self.r: E = None
        self.txt = txt

j = A("j")
k = B("k")
n = C("n")
g = D("g")
m = E("m")
d = F("d")
i = G("i")
e = H("e")
l = H("l")

j.o = n
j.x = m
j.z = m
k.s = j
k.v = g
k.r = g
k.w = d
k.z = i
k.y = i
n.q = k
n.s = k
n.w = m
n.y = g
n.o = e
n.u = e
g.w = n
g.o = n
g.q = i
g.y = i
g.s = k
g.u = k
g.v = j
g.p = l
m.p = l
m.r = j
m.u = j
m.q = j
m.x = j
m.t = g
m.w = g
m.v = n
d.u = n
i.x = d
i.u = g
i.w = g
i.q = k
i.p = e
e.o = i
e.q = i
e.v = d
e.r = m
l.o = i
l.q = i
l.v = d
l.r = m
assert m.u.o.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: C = None
        self.q: G = None
        self.s: B = None
        self.u: B = None
        self.v: A = None
        self.y: G = None
        self.p: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: A = None
        self.u: A = None
        self.t: D = None
        self.q: A = None
        self.x: A = None
        self.w: D = None
        self.v: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: D = None
        self.w: D = None
        self.q: B = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.v: F = None
        self.r: E = None
        self.txt = txt

j = A("j")
k = B("k")
n = C("n")
g = D("g")
m = E("m")
d = F("d")
i = G("i")
e = H("e")
l = H("l")

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