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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.q: A = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: E = None
        self.y: A = None
        self.x: C = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: I = None
        self.x: I = None
        self.q: B = None
        self.r: A = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.w: B = None
        self.u: I = None
        self.q: J = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: B = None
        self.t: B = None
        self.o: A = None
        self.s: F = None
        self.y: I = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.q: A = None
        self.z: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: J = None
        self.s: E = None
        self.y: A = None
        self.x: C = None
        self.v: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: I = None
        self.x: I = None
        self.q: B = None
        self.r: A = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: J = None
        self.w: B = None
        self.u: I = None
        self.q: J = None
        self.x: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: B = None
        self.t: B = None
        self.o: A = None
        self.s: F = None
        self.y: I = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

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

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

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