class A:
    def __init__(self, txt: str):
        self.v: J = None
        self.w: H = None
        self.t: I = None
        self.r: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: I = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: I = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

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

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