class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: E = None
        self.p: C = None
        self.q: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: E = None
        self.u: F = None
        self.r: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: C = None
        self.w: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.v: C = None
        self.u: D = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: J = None
        self.r: I = None
        self.v: A = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.v: F = None
        self.o: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: E = None
        self.u: F = None
        self.r: J = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: C = None
        self.w: B = None
        self.q: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: D = None
        self.v: C = None
        self.u: D = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: J = None
        self.r: I = None
        self.v: A = None
        self.w: C = None
        self.x: F = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: E = None
        self.v: F = None
        self.o: F = None
        self.txt = txt

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

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