class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: D = None
        self.u: B = None
        self.w: H = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: B = None
        self.r: G = None
        self.t: I = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.y: C = None
        self.w: H = None
        self.s: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.w: F = None
        self.v: E = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.t: D = None
        self.v: G = None
        self.z: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: F = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: I = None
        self.z: B = None
        self.r: G = None
        self.t: I = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: D = None
        self.y: C = None
        self.w: H = None
        self.s: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: C = None
        self.w: F = None
        self.v: E = None
        self.r: G = None
        self.y: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: B = None
        self.x: D = None
        self.t: D = None
        self.v: G = None
        self.z: B = None
        self.txt = txt

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

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