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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.q: J = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: I = None
        self.y: F = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.q: G = None
        self.o: I = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: B = None
        self.q: B = None
        self.s: C = None
        self.y: A = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.x: G = None
        self.p: F = None
        self.s: E = None
        self.u: A = None
        self.r: J = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: D = None
        self.u: D = None
        self.y: I = None
        self.t: I = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: E = None
        self.q: J = None
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.w: I = None
        self.y: F = None
        self.p: B = None
        self.r: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: G = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: A = None
        self.q: G = None
        self.o: I = None
        self.y: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.z: B = None
        self.q: B = None
        self.s: C = None
        self.y: A = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: C = None
        self.y: G = None
        self.x: G = None
        self.p: F = None
        self.s: E = None
        self.u: A = None
        self.r: J = None
        self.v: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: D = None
        self.u: D = None
        self.y: I = None
        self.t: I = None
        self.w: F = None
        self.txt = txt

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

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