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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: G = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.q: E = None
        self.p: H = None
        self.o: B = None
        self.s: I = None
        self.r: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.z: C = None
        self.p: H = None
        self.q: I = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: G = None
        self.q: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.q: E = None
        self.p: H = None
        self.o: B = None
        self.s: I = None
        self.r: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.w: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: F = None
        self.z: C = None
        self.p: H = None
        self.q: I = None
        self.s: C = None
        self.txt = txt

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

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