class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.q: I = None
        self.p: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: F = None
        self.u: H = None
        self.q: E = None
        self.z: C = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: B = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: H = None
        self.s: B = None
        self.u: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: E = None
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: F = None
        self.u: H = None
        self.q: E = None
        self.z: C = None
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.u: B = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: H = None
        self.s: B = None
        self.u: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: E = None
        self.o: C = None
        self.txt = txt

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

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

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