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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: F = None
        self.r: H = None
        self.p: G = None
        self.q: D = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: G = None
        self.r: D = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: F = None
        self.u: C = None
        self.z: C = None
        self.txt = txt

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

b.p = h
b.y = e
l.q = m
l.v = h
m.y = c
m.v = h
e.p = f
e.y = f
e.u = c
e.z = n
e.r = l
e.s = h
e.w = d
h.u = e
h.q = e
h.y = c
h.r = d
h.p = j
h.s = n
c.p = n
c.t = j
c.r = e
c.z = m
c.v = m
j.w = e
j.r = d
d.v = h
d.u = l
n.r = j
n.w = c
n.u = m
n.z = m
f.p = h
f.y = e
assert n.r.r.u.q.v.u.r.v.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: F = None
        self.r: H = None
        self.p: G = None
        self.q: D = None
        self.s: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: G = None
        self.r: D = None
        self.z: C = None
        self.v: C = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.w: F = None
        self.u: C = None
        self.z: C = None
        self.txt = txt

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

b.p = h
b.y = e
l.q = m
l.v = h
m.y = c
m.v = h
e.p = f
e.y = f
e.u = c
e.z = n
e.r = l
e.s = h
e.w = d
h.u = e
h.q = e
h.y = c
h.r = d
h.p = j
h.s = n
c.p = n
c.t = j
c.r = e
c.z = m
c.v = m
j.w = e
j.r = d
d.v = h
d.u = l
n.r = j
n.w = c
n.u = m
n.z = m
f.p = h
f.y = e
assert n.r.r.u.q.v.u.r.v.y.v.txt == "m"