class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: D = None
        self.q: F = None
        self.p: D = None
        self.x: C = None
        self.s: H = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: J = None
        self.x: I = None
        self.v: G = None
        self.q: C = None
        self.u: G = None
        self.s: I = None
        self.y: J = None
        self.o: G = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: J = None
        self.z: B = None
        self.q: H = None
        self.o: E = None
        self.txt = txt

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

c = A("c")
e = B("e")
m = C("m")
a = D("a")
d = E("d")
n = F("n")
i = G("i")
g = H("g")
l = I("l")
f = J("f")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: J = None
        self.x: I = None
        self.v: G = None
        self.q: C = None
        self.u: G = None
        self.s: I = None
        self.y: J = None
        self.o: G = None
        self.w: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: H = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: J = None
        self.o: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: J = None
        self.z: B = None
        self.q: H = None
        self.o: E = None
        self.txt = txt

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

c = A("c")
e = B("e")
m = C("m")
a = D("a")
d = E("d")
n = F("n")
i = G("i")
g = H("g")
l = I("l")
f = J("f")

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