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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: C = None
        self.r: I = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.p: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.u: H = None
        self.t: G = None
        self.z: G = None
        self.o: J = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.s: C = None
        self.r: I = None
        self.q: E = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.p: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: A = None
        self.u: H = None
        self.t: G = None
        self.z: G = None
        self.o: J = None
        self.v: D = None
        self.txt = txt

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

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

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