class A:
    def __init__(self, txt: str):
        self.q: J = None
        self.t: I = None
        self.y: E = None
        self.o: E = None
        self.v: I = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: C = None
        self.q: I = None
        self.t: A = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: J = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: B = None
        self.z: I = None
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: C = None
        self.q: I = None
        self.t: A = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: J = None
        self.y: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: B = None
        self.z: I = None
        self.t: H = None
        self.txt = txt

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

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