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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

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