class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.q: H = None
        self.u: J = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.v: D = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.s: D = None
        self.u: J = None
        self.o: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.x: E = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: A = None
        self.z: F = None
        self.p: A = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: I = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: B = None
        self.q: H = None
        self.u: J = None
        self.v: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: F = None
        self.v: D = None
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: B = None
        self.s: D = None
        self.u: J = None
        self.o: J = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: H = None
        self.x: E = None
        self.w: H = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: A = None
        self.z: F = None
        self.p: A = None
        self.w: G = None
        self.txt = txt

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

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