class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.u: H = None
        self.x: A = None
        self.p: I = None
        self.z: G = None
        self.v: C = None
        self.y: G = None
        self.r: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: A = None
        self.s: F = None
        self.w: J = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
m = C("m")
f = D("f")
d = E("d")
i = F("i")
b = G("b")
h = H("h")
g = I("g")
n = J("n")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: A = None
        self.t: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: G = None
        self.u: H = None
        self.x: A = None
        self.p: I = None
        self.z: G = None
        self.v: C = None
        self.y: G = None
        self.r: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: G = None
        self.t: A = None
        self.s: F = None
        self.w: J = None
        self.y: E = None
        self.q: B = None
        self.txt = txt

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

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

c = A("c")
k = B("k")
m = C("m")
f = D("f")
d = E("d")
i = F("i")
b = G("b")
h = H("h")
g = I("g")
n = J("n")

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