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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.r: F = None
        self.y: E = None
        self.v: G = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: A = None
        self.r: F = None
        self.y: E = None
        self.v: G = None
        self.z: B = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: C = None
        self.w: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: A = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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